分包商单位增加委托书上传
This commit is contained in:
parent
54c4bad8cb
commit
1c89c3f1dc
|
|
@ -84,7 +84,7 @@
|
||||||
v-model="maForm.phone"
|
v-model="maForm.phone"
|
||||||
placeholder="请输入联系电话"
|
placeholder="请输入联系电话"
|
||||||
clearable
|
clearable
|
||||||
maxlength="50"
|
maxlength="11"
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
|
|
@ -154,13 +154,14 @@
|
||||||
rows="2"
|
rows="2"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="委托书" prop="fileFbs" v-if="isFileFbs">
|
<el-form-item label="委托书" prop="bmFileInfos" v-if="isFileFbs">
|
||||||
<el-upload
|
<el-upload
|
||||||
action="#"
|
:action="uploadUrl"
|
||||||
:file-list="businessLicenseListTemp"
|
:file-list="maForm.bmFileInfos"
|
||||||
:show-file-list="true"
|
:show-file-list="true"
|
||||||
:auto-upload="false"
|
:auto-upload="true"
|
||||||
:key="uploadKey"
|
:key="uploadKey"
|
||||||
|
:limit="5"
|
||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
accept=".png, .jpg, .jpeg, .pdf"
|
accept=".png, .jpg, .jpeg, .pdf"
|
||||||
:on-change="handleChangeBusinessList"
|
:on-change="handleChangeBusinessList"
|
||||||
|
|
@ -234,7 +235,7 @@
|
||||||
<el-input
|
<el-input
|
||||||
v-model.number="scope.row.preNum"
|
v-model.number="scope.row.preNum"
|
||||||
controls-position="right" type="number"
|
controls-position="right" type="number"
|
||||||
style="width: 100%" :disabled="scope.row.alNum&&scope.row.alNum!=0"
|
style="width: 100%" :disabled="scope.row.alNum && scope.row.alNum != 0 ? true : false"
|
||||||
:min="0" @input="(v)=>(scope.row.unitValue==1?scope.row.preNum=Number(v.replace(/[^\d.]/g,'')) : scope.row.preNum=Number(v.replace(/[^\d]/g,'')))"
|
:min="0" @input="(v)=>(scope.row.unitValue==1?scope.row.preNum=Number(v.replace(/[^\d.]/g,'')) : scope.row.preNum=Number(v.replace(/[^\d]/g,'')))"
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -374,6 +375,7 @@ export default {
|
||||||
purchaser: "",
|
purchaser: "",
|
||||||
remark: "",
|
remark: "",
|
||||||
purchaseNumber: "",
|
purchaseNumber: "",
|
||||||
|
bmFileInfos: [],
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
|
@ -412,7 +414,7 @@ export default {
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
fileFbs: [
|
bmFileInfos: [
|
||||||
{
|
{
|
||||||
required: false,//是否分包商(是:合同编号必填)
|
required: false,//是否分包商(是:合同编号必填)
|
||||||
message: '请上传委托书',
|
message: '请上传委托书',
|
||||||
|
|
@ -456,7 +458,6 @@ export default {
|
||||||
|
|
||||||
//是否是分包商
|
//是否是分包商
|
||||||
isFileFbs:false,
|
isFileFbs:false,
|
||||||
businessLicenseListTemp: [],
|
|
||||||
urlTemp: '',
|
urlTemp: '',
|
||||||
delBusinessFileIdList: [],
|
delBusinessFileIdList: [],
|
||||||
//图片查看弹窗
|
//图片查看弹窗
|
||||||
|
|
@ -464,18 +465,19 @@ export default {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
uploadKey: Date.now(),
|
uploadKey: Date.now(),
|
||||||
//上传
|
//上传
|
||||||
upload: {
|
// upload: {
|
||||||
// 设置上传的请求头部
|
// // 设置上传的请求头部
|
||||||
headers: {Authorization: 'Bearer ' + getToken()},
|
// headers: {Authorization: 'Bearer ' + getToken()},
|
||||||
// 上传的地址
|
// // 上传的地址
|
||||||
url: process.env.VUE_APP_BASE_API + '/file/upload'
|
// url: process.env.VUE_APP_BASE_API + '/file/upload'
|
||||||
},
|
// },
|
||||||
|
uploadUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
//图片上传1张后,隐藏上传框
|
//图片上传1张后,隐藏上传框
|
||||||
uploadDisabled() {
|
uploadDisabled() {
|
||||||
return this.businessLicenseListTemp.length > 4
|
return this.maForm.bmFileInfos && this.maForm.bmFileInfos.length == 5
|
||||||
},
|
},
|
||||||
pickerOptions() {
|
pickerOptions() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -521,10 +523,10 @@ export default {
|
||||||
// }
|
// }
|
||||||
if(val.typeKey=='fbs'){
|
if(val.typeKey=='fbs'){
|
||||||
this.isFileFbs=true;
|
this.isFileFbs=true;
|
||||||
this.rules['fileFbs'][0].required=true;
|
this.rules['bmFileInfos'][0].required=true;
|
||||||
}else{
|
}else{
|
||||||
this.isFileFbs=false;
|
this.isFileFbs=false;
|
||||||
this.rules['fileFbs'][0].required=false;
|
this.rules['bmFileInfos'][0].required=false;
|
||||||
}
|
}
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
getListProject({ unitId: this.maForm.unitId }).then((response) => {
|
getListProject({ unitId: this.maForm.unitId }).then((response) => {
|
||||||
|
|
@ -685,6 +687,10 @@ export default {
|
||||||
this.maForm.projectId
|
this.maForm.projectId
|
||||||
);
|
);
|
||||||
this.equipmentList = response.data.leaseApplyDetailsList;
|
this.equipmentList = response.data.leaseApplyDetailsList;
|
||||||
|
// 如果 bmFileInfos有值
|
||||||
|
if (this.maForm.bmFileInfos.length > 0) {
|
||||||
|
this.isFileFbs = true
|
||||||
|
}
|
||||||
// this.loading = false;
|
// this.loading = false;
|
||||||
});
|
});
|
||||||
// await this.projectInfoList();
|
// await this.projectInfoList();
|
||||||
|
|
@ -725,10 +731,10 @@ export default {
|
||||||
// console.log(this.equipmentList)
|
// console.log(this.equipmentList)
|
||||||
console.log("maForm", this.maForm);
|
console.log("maForm", this.maForm);
|
||||||
if (this.equipmentList.length > 0) {
|
if (this.equipmentList.length > 0) {
|
||||||
if(this.businessLicenseListTemp.length > 0){
|
// if(this.bmFileInfos.length > 0){
|
||||||
console.log(33333333333333333333333333333333333)
|
// console.log(33333333333333333333333333333333333)
|
||||||
this.$refs["maForm"].clearValidate('fileFbs');
|
// this.$refs["maForm"].clearValidate('bmFileInfos');
|
||||||
}
|
// }
|
||||||
this.$refs["maForm"].validate(async (valid) => {
|
this.$refs["maForm"].validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
for(let i = 0;i<this.equipmentList.length;i++){
|
for(let i = 0;i<this.equipmentList.length;i++){
|
||||||
|
|
@ -986,18 +992,21 @@ export default {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.businessLicenseListTemp = fileList;
|
this.maForm.bmFileInfos = fileList;
|
||||||
// // 根据 businessLicenseListTemp 是否有值来控制 fileFbs 的验证
|
console.log('🚀 ~ handleChangeBusinessList ~ this.bmFileInfos:', this.bmFileInfos)
|
||||||
// if (this.businessLicenseListTemp.length > 0) {
|
// 手动触发表单验证
|
||||||
// // this.maForm.fileFbs = fileList.map(item => item.raw); // 假设需要上传文件对象;
|
this.$refs.maForm.validateField('bmFileInfos');
|
||||||
|
// // 根据 bmFileInfos 是否有值来控制 bmFileInfos 的验证
|
||||||
|
// if (this.bmFileInfos.length > 0) {
|
||||||
|
// // this.maForm.bmFileInfos = fileList.map(item => item.raw); // 假设需要上传文件对象;
|
||||||
// // 有值,手动标记验证通过
|
// // 有值,手动标记验证通过
|
||||||
// console.log('222222222222222')
|
// console.log('222222222222222')
|
||||||
// this.$refs.maForm.clearValidate('fileFbs');
|
// this.$refs.maForm.clearValidate('bmFileInfos');
|
||||||
// } else {
|
// } else {
|
||||||
// // maForm.fileFbs = false;
|
// // maForm.bmFileInfos = false;
|
||||||
// console.log('33333333')
|
// console.log('33333333')
|
||||||
// // 无值,手动触发验证失败
|
// // 无值,手动触发验证失败
|
||||||
// this.$refs.maForm.validateField('fileFbs');
|
// this.$refs.maForm.validateField('bmFileInfos');
|
||||||
// }
|
// }
|
||||||
|
|
||||||
console.log('4444444444')
|
console.log('4444444444')
|
||||||
|
|
@ -1049,12 +1058,12 @@ export default {
|
||||||
//上传组件-图片删除
|
//上传组件-图片删除
|
||||||
handleRemoveElectricianImgList(file, fileList) {
|
handleRemoveElectricianImgList(file, fileList) {
|
||||||
let sum = 0
|
let sum = 0
|
||||||
this.businessLicenseListTemp.forEach((item, index) => {
|
this.maForm.bmFileInfos.forEach((item, index) => {
|
||||||
if (item.uid == file.uid) {
|
if (item.uid == file.uid) {
|
||||||
sum = index
|
sum = index
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.businessLicenseListTemp.splice(sum, 1)
|
this.maForm.bmFileInfos.splice(sum, 1)
|
||||||
if (file.status == 'success') {
|
if (file.status == 'success') {
|
||||||
this.delBusinessFileIdList.push(file.url);
|
this.delBusinessFileIdList.push(file.url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue