add
This commit is contained in:
parent
abb49b0794
commit
6dad68647a
@ -68,7 +68,10 @@
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件">
|
||||
<el-upload
|
||||
<annexUpload :annex="formData.annex" @handleAvatarSuccess="handleAvatarSuccess_four"
|
||||
@delFile="delFileFn" />
|
||||
|
||||
<!-- <el-upload
|
||||
accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv"
|
||||
class="upload-demo" :show-file-list="false" aria-hidden="true"
|
||||
:headers="{ Token: userStore.token }" :action="base_url + '/upload/file'"
|
||||
@ -84,7 +87,7 @@
|
||||
:href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -147,36 +150,21 @@ import { useDictData } from '@/hooks/useDictOptions'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const protype = reactive([])
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const formDataannex = reactive([])
|
||||
const bidding_code = ref('')
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const bidding_time = ref('')
|
||||
const custom_name = ref('')
|
||||
const { dictData } = useDictData('refund_type,isaccrued,contract_type')
|
||||
const userInfo = userStore.userInfo
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
const handleAvatarSuccess_four = (response: any) => {
|
||||
Array.isArray(formData.annex) ? '' : formData.annex = []
|
||||
// @ts-ignore
|
||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
||||
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
@ -235,7 +223,7 @@ const formData = reactive({
|
||||
refund_amount: "",
|
||||
refund_date: "",
|
||||
remark: "",
|
||||
annex: "",
|
||||
annex: [],
|
||||
bank_account_id: '',
|
||||
"bank_account_info": {
|
||||
"account_sn": "",
|
||||
@ -256,20 +244,6 @@ const formRules = reactive<any>({
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.return_desc && data.return_desc.length > 0) {
|
||||
|
||||
const arry1 = data.return_desc.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
@ -277,10 +251,11 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
}
|
||||
}
|
||||
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_code
|
||||
custom_name.value = data.custom.name
|
||||
bidding_time.value = data.decision.bidding_time
|
||||
project_name.value = data.project_name
|
||||
project_code.value = data.project_code
|
||||
custom_name.value = data.custom_name
|
||||
bidding_time.value = data.bidding_time
|
||||
bidding_code.value = data.bidding_decision_code
|
||||
amountinput(data.refund_amount)
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user