|
@@ -61,7 +61,25 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="草图文件:">
|
|
|
- <hc-form-upload :src="baseForm.pictureList" :h-props="uploadFormProps" :disabled="isView" @upload="formUpload" @change="formUploadChange" />
|
|
|
+ <hc-form-upload
|
|
|
+ v-model="baseForm.pictureList"
|
|
|
+ :disabled="isView"
|
|
|
+ is-success
|
|
|
+ :options="{
|
|
|
+ type: 'list',
|
|
|
+ props: uploadFormProps,
|
|
|
+ isArr: true,
|
|
|
+ }"
|
|
|
+ :upload="{
|
|
|
+ options: {
|
|
|
+ accept: '.png,.jpg,.jpeg',
|
|
|
+ accept_tip: '图片(png、jpg、jpeg)',
|
|
|
+ size: 50,
|
|
|
+ multiple: false,
|
|
|
+ },
|
|
|
+ }"
|
|
|
+ @success="pictureUploadSuccess"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
@@ -124,12 +142,18 @@
|
|
|
<el-form :model="baseForm" label-position="left" label-width="auto">
|
|
|
<el-form-item label="上传附件">
|
|
|
<hc-form-upload
|
|
|
- type="list"
|
|
|
- :src="baseForm.fileList"
|
|
|
- :disabled="isView"
|
|
|
- :h-props="uploadFormProps"
|
|
|
+ v-model="baseForm.fileList"
|
|
|
+ disabled="isView"
|
|
|
+ is-del
|
|
|
+ is-success
|
|
|
+ :options="{
|
|
|
+ type: 'list',
|
|
|
+ props: uploadFormProps,
|
|
|
+ isArr: true,
|
|
|
+ num: 0,
|
|
|
+ }"
|
|
|
+ @success="fileUploadSuccess"
|
|
|
@del="attachMentDel"
|
|
|
- @upload="attachmentUpload"
|
|
|
@change="attachmentUploadChange"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -143,14 +167,6 @@
|
|
|
<!-- 添加分解清单 -->
|
|
|
<HcBillBaseModal v-model="addBillBaseModalShow" :data-id="dataId" :ids="billBaseIds" :idn="nodeId" :period-id="baseForm.contractPeriodId" :contract-id="cid" @finish="finishChange" />
|
|
|
|
|
|
- <!-- 文件上传组件 -->
|
|
|
- <hc-upload-file
|
|
|
- ref="uploadFileRef"
|
|
|
- :echo-params="uploadFileParams"
|
|
|
- :options="uploadFileOptions"
|
|
|
- @success="uploadFileSuccess"
|
|
|
- />
|
|
|
-
|
|
|
<!-- 关联质检资料 -->
|
|
|
<qualityRleation :quality-moadal="qualityMoadal" :cid="cid" :period-id="period_id" :select-id="selectId" :is-remian-old-check="true" :disabled="baseForm?.isAutoBuild === 1" @close="closeQual" @finish="finishModal" />
|
|
|
</template>
|
|
@@ -303,7 +319,7 @@ watch(() => baseForm.value.fileList, (list) => {
|
|
|
if (!ischangeByGetNode.value) {
|
|
|
ele.upPayRatio = ele.oldupPayRatio || '0.00'
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -453,19 +469,6 @@ const getMeterNumber = async (periodId) => {
|
|
|
baseForm.value.meterNumber = data ?? ''
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-//草图文件上传
|
|
|
-const formUpload = () => {
|
|
|
- uploadFileParams.value = { type: '草图文件' }
|
|
|
- uploadFileOptions.value.accept = 'image/png,image/jpg,image/jpeg'
|
|
|
- uploadFileOptions.value.accept_tip = '图片(png、jpg、jpeg)'
|
|
|
- uploadFileOptions.value.size = 50
|
|
|
- uploadFileRef.value?.selectFile()
|
|
|
-}
|
|
|
-const formUploadChange = (url) => {
|
|
|
- baseForm.value.pictureUrl = url
|
|
|
-}
|
|
|
-
|
|
|
//收方清单列表
|
|
|
const addTableColumn = ref([
|
|
|
{ key: 'formNumber', name: '清单编号', width: '120' },
|
|
@@ -693,70 +696,54 @@ const uploadFormProps = {
|
|
|
name: 'fileName',
|
|
|
}
|
|
|
|
|
|
-const attachmentUpload = () => {
|
|
|
- uploadFileParams.value = { type: '附件文件' }
|
|
|
- uploadFileOptions.value.accept = ''
|
|
|
- uploadFileOptions.value.accept_tip = ''
|
|
|
- uploadFileOptions.value.size = null
|
|
|
- uploadFileRef.value?.selectFile()
|
|
|
-}
|
|
|
-const attachmentUploadChange = (name, index, fileList) => {
|
|
|
-
|
|
|
- baseForm.value.fileList = getArrValue(fileList)
|
|
|
- if (deleFile.value) {
|
|
|
- baseForm.value.fileList.push(deleFile.value)
|
|
|
- }
|
|
|
+const attachmentUploadChange = () => {
|
|
|
+ const fileList = getArrValue(baseForm.value.fileList)
|
|
|
ischangeByGetNode.value = false
|
|
|
- selectId.value = arrToKey( baseForm.value.fileList, 'selectId', ',')
|
|
|
+ selectId.value = arrToKey(fileList, 'selectId', ',')
|
|
|
}
|
|
|
-const deleFile = ref(null)
|
|
|
-const attachMentDel = ({ index, file })=>{
|
|
|
+
|
|
|
+const attachMentDel = ({ file }, resolve)=>{
|
|
|
const { selectId } = file
|
|
|
if (selectId && baseForm.value.isAutoBuild === 1) {
|
|
|
window.$message.warning('该文件不可删除')
|
|
|
- deleFile.value = file
|
|
|
- return
|
|
|
+ resolve(false)
|
|
|
} else {
|
|
|
- deleFile.value = null
|
|
|
+ resolve(true)
|
|
|
}
|
|
|
}
|
|
|
-//文件上传
|
|
|
-const uploadFileRef = ref(null)
|
|
|
-const uploadFileParams = ref({})
|
|
|
-const uploadFileOptions = ref({
|
|
|
- headers: getHeader(),
|
|
|
- multiple: false,
|
|
|
-})
|
|
|
|
|
|
-// 文件上传成功的回调
|
|
|
-const uploadFileSuccess = ({ echoParams, resData }) => {
|
|
|
- const { pdfUrl } = resData
|
|
|
- if (isNullES(pdfUrl)) {
|
|
|
+//草图文件上传成功的回调
|
|
|
+const pictureUploadSuccess = ({ res }, resolve) => {
|
|
|
+ if (isNullES(res.pdfUrl)) {
|
|
|
window.$message.warning('该文件不能生成pdf,请更换文件上传')
|
|
|
- uploadFileRef.value?.setModalShow(false)
|
|
|
+ resolve()
|
|
|
return
|
|
|
}
|
|
|
- if (echoParams.type === '草图文件') {
|
|
|
- baseForm.value.pictureUrl = resData.link ?? ''
|
|
|
- baseForm.value.pictureName = resData.originalName ?? ''
|
|
|
- baseForm.value.pictureList = [{
|
|
|
- fileName: resData.originalName ?? '',
|
|
|
- filePdfUrl: resData.pdfUrl ?? '',
|
|
|
- fileUrl: resData.link ?? '',
|
|
|
- }]
|
|
|
- uploadFileRef.value?.setModalShow(false)
|
|
|
- } else if (echoParams.type === '附件文件') {
|
|
|
- baseForm.value.fileList.push({
|
|
|
- contractId: cid.value,
|
|
|
- fileName: resData.originalName ?? '',
|
|
|
- filePdfUrl: resData.pdfUrl ?? '',
|
|
|
- fileUrl: resData.link ?? '',
|
|
|
- fileType: 1,
|
|
|
- })
|
|
|
- uploadFileRef.value?.setModalShow(false)
|
|
|
- }
|
|
|
+ baseForm.value.pictureUrl = res.link ?? ''
|
|
|
+ baseForm.value.pictureName = res.originalName ?? ''
|
|
|
+ resolve({
|
|
|
+ fileName: res.originalName ?? '',
|
|
|
+ filePdfUrl: res.pdfUrl ?? '',
|
|
|
+ fileUrl: res.link ?? '',
|
|
|
+ })
|
|
|
ischangeByGetNode.value = false
|
|
|
+}
|
|
|
|
|
|
+//附件上传成功的回调
|
|
|
+const fileUploadSuccess = ({ res }, resolve) => {
|
|
|
+ if (isNullES(res.pdfUrl)) {
|
|
|
+ window.$message.warning('该文件不能生成pdf,请更换文件上传')
|
|
|
+ resolve()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resolve({
|
|
|
+ contractId: cid.value,
|
|
|
+ fileName: res.originalName ?? '',
|
|
|
+ filePdfUrl: res.pdfUrl ?? '',
|
|
|
+ fileUrl: res.link ?? '',
|
|
|
+ fileType: 1,
|
|
|
+ })
|
|
|
+ ischangeByGetNode.value = false
|
|
|
}
|
|
|
|
|
|
//保存
|