li.shaoyi 3 anni fa
parent
commit
ac3f73048e

+ 2 - 2
src/packages/pc/views/customs/bonded/components/upload-bill/index.vue

@@ -69,9 +69,9 @@ const onCancel = (isRefresh = false) => {
     refresh.value = isRefresh
 }
 
-const onUploadChange = (files: { fileName: string, filePath: string }[]) => {
+const onUploadChange = (files: { originalName: string, filePath: string }[]) => {
     formData.FileDetails = files.map((e) => ({
-        FileName: e.fileName,
+        FileName: e.originalName,
         FilePath: e.filePath,
     }))
     formRef.value?.validateField('FileDetails')

+ 2 - 2
src/packages/pc/views/customs/bonded/components/upload-seal/index.vue

@@ -60,9 +60,9 @@ const onCancel = (isRefresh = false) => {
     refresh.value = isRefresh
 }
 
-const onUploadChange = (files: { fileName: string, filePath: string }[]) => {
+const onUploadChange = (files: { originalName: string, filePath: string }[]) => {
     formData.FileDetails = files.map((e) => ({
-        FileName: e.fileName,
+        FileName: e.originalName,
         FilePath: e.filePath,
     }))
 }

+ 16 - 2
src/packages/pc/views/order/main/components/contracted/index.vue

@@ -12,7 +12,7 @@
                 <el-input type="textarea" :rows="3" v-model="formData.ApplyRemark" />
             </el-form-item>
             <el-form-item label="附件" prop="Attachment">
-                <app-upload />
+                <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="onUploadChange" />
             </el-form-item>
         </el-form>
         <template #footer>
@@ -44,7 +44,21 @@ const refresh = ref(false)
 const formRef = ref<FormInstance>()
 
 const formRules: FormRules = {
-    ApplyRemark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
+    Attachment: [{
+        required: true,
+        validator: (rule, value, callback) => {
+            if (formData.Attachment) {
+                callback()
+            } else {
+                callback(new Error('请上传附件'))
+            }
+        }
+    }],
+}
+
+const onUploadChange = (file: { filePath: string }) => {
+    formData.Attachment = file.filePath
+    formRef.value?.validateField('Attachment')
 }
 
 const onCancel = (isRefresh = false) => {