Browse Source

完善合格证管理--增加仅保存车架号的功能

master
yunuo970428 1 year ago
parent
commit
1d2df2c388
  1. 9
      anrui-scm/anrui-scm-ui/src/api/cheliang/basevehiclecertificate.js
  2. 64
      anrui-scm/anrui-scm-ui/src/views/cheliang/hegezhengtaizhang/hegezhengtaizhangAdd.vue

9
anrui-scm/anrui-scm-ui/src/api/cheliang/basevehiclecertificate.js

@ -30,6 +30,15 @@ export function Update(data) {
}) })
} }
// 修改
export function updateVinNo(data) {
return request({
url: 'base/v1/basevehiclecertificate/updateVinNo',
method: 'post',
params: data
})
}
// 删除 // 删除
export function deleteBySids(data) { export function deleteBySids(data) {
return request({ return request({

64
anrui-scm/anrui-scm-ui/src/views/cheliang/hegezhengtaizhang/hegezhengtaizhangAdd.vue

@ -4,6 +4,7 @@
<div>{{ viewTitle }}</div> <div>{{ viewTitle }}</div>
<div> <div>
<el-button type="primary" size="small" @click="handleCreate()">保存</el-button> <el-button type="primary" size="small" @click="handleCreate()">保存</el-button>
<el-button type="primary" size="small" @click="saveVinNo()">仅保存车架号</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div> </div>
</div> </div>
@ -299,16 +300,16 @@
<el-dialog center :visible.sync="dialogVisible" width="50%" :close-on-click-modal="false"> <el-dialog center :visible.sync="dialogVisible" width="50%" :close-on-click-modal="false">
<el-form class="formadd"> <el-form class="formadd">
<el-row style="border-top: 1px solid #E0E3EB"> <el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="3" class="tleftb"> <el-col :span="4" class="tleftb">
<span>说明原因</span> <span>说明原因</span>
</el-col> </el-col>
<el-col :span="21"> <el-col :span="20">
<el-form-item><el-input v-model="smRemarks" type="textarea" :rows="3" maxlength="125" placeholder="" class="addinputw addinputw_remarks" clearable/></el-form-item> <el-form-item><el-input v-model="smRemarks" type="textarea" :rows="3" maxlength="125" placeholder="" class="addinputw addinputw_remarks" clearable/></el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="handleCreate"> </el-button> <el-button type="primary" size="small" @click="handleConfirm"> </el-button>
<el-button size="small" @click="handleQuXiao"> </el-button> <el-button size="small" @click="handleQuXiao"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -316,9 +317,10 @@
</template> </template>
<script> <script>
import { details, SaveList, Update } from '@/api/cheliang/basevehiclecertificate' import { details, SaveList, Update, updateVinNo } from '@/api/cheliang/basevehiclecertificate'
import { typeValues } from '@/api/cheliang/dictcommons' import { typeValues } from '@/api/cheliang/dictcommons'
import ImageUpload from '@/components/uploadFile/ManyImageUpload' // import ImageUpload from '@/components/uploadFile/ManyImageUpload' //
export default { export default {
name: 'PinpaiAdd', name: 'PinpaiAdd',
components: { ImageUpload }, components: { ImageUpload },
@ -329,6 +331,7 @@ export default {
smRemarks: '', smRemarks: '',
FormLoading: false, FormLoading: false,
listLoading: false, listLoading: false,
vinNodisabled: false,
temp: { temp: {
createOrgSid: '', createOrgSid: '',
certificateSituation: '', certificateSituation: '',
@ -462,10 +465,54 @@ export default {
fileChangeIt(files, imgFiles) { fileChangeIt(files, imgFiles) {
this.temp.certificatePhoto = imgFiles this.temp.certificatePhoto = imgFiles
}, },
handleConfirm() {
if (this.vinNodisabled) {
this.saveVinNo()
} else {
this.handleCreate()
}
},
handleQuXiao() {
this.smRemarks = ''
this.dialogVisible = false
},
saveVinNo() {
if (this.temp.vinNo !== '' && this.temp.vinNo !== null && this.temp.vinNo !== undefined && this.temp.vinNo.length < 17) {
this.$message({ showClose: true, type: 'error', message: '请检查车架号的长度应为17位' })
return
}
this.temp.smRemarks = this.smRemarks
updateVinNo({ sid: this.temp.sid, vinNo: this.temp.vinNo, smRemarks: this.temp.smRemarks }).then((response) => {
this.FormLoading = false
if (response.success) {
if (response.msg !== '该车架号后八位与车辆台账中车架号不符,请填写说明原因') {
this.dialogFormVisible = false
this.$notify({
title: '提示',
message: '修改成功',
type: 'success',
duration: 2000
})
this.handleReturn('true')
} else {
const tip = response.msg
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.smRemarks = ''
this.dialogVisible = true
this.vinNodisabled = true
})
}
}
})
},
// //
handleCreate() { handleCreate() {
if (this.temp.vinNo !== '' && this.temp.vinNo !== null && this.temp.vinNo !== undefined && this.temp.vinNo.length < 17 && this.temp.vinNo.length !== 8) { if (this.temp.vinNo !== '' && this.temp.vinNo !== null && this.temp.vinNo !== undefined && this.temp.vinNo.length < 17) {
this.$message({ showClose: true, type: 'error', message: '请检查车架号的长度应为8位或17位' }) this.$message({ showClose: true, type: 'error', message: '请检查车架号的长度应为17位' })
return return
} }
if (this.temp.certificateStateValue === '正式' && this.temp.carModel === '') { if (this.temp.certificateStateValue === '正式' && this.temp.carModel === '') {
@ -522,10 +569,6 @@ export default {
} }
}) })
}, },
handleQuXiao() {
this.smRemarks = ''
this.dialogVisible = false
},
// //
handleReturn(isreload) { handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist') if (isreload === 'true') this.$emit('reloadlist')
@ -539,6 +582,7 @@ export default {
} // } //
this.dialogVisible = false this.dialogVisible = false
this.smRemarks = '' this.smRemarks = ''
this.vinNodisabled= false
this.$emit('doback') this.$emit('doback')
} }
} }

Loading…
Cancel
Save