diff --git a/src/views/user/contract-manage/index.vue b/src/views/user/contract-manage/index.vue
index e52a769..d345fce 100644
--- a/src/views/user/contract-manage/index.vue
+++ b/src/views/user/contract-manage/index.vue
@@ -172,7 +172,7 @@
ref="addAndEditFormRef"
label-position="right"
:model="addAndEditForm"
- :rules="htRules"
+ :rules="addAndEditFormRules"
>
@@ -187,28 +187,56 @@
-
-
+
-
- 点击上传
-
- 支持格式:.word.单个文件大小不能超过2M
-
+ 支持格式:word.单个文件大小不能超过2M,最多可上传1张
+
+
+
+
+
+
+
+
+
+
+ 上传文件
+
+
+
+
+
+
@@ -230,12 +258,14 @@ const store2 = mainStore()
const isViewForm = ref(false)
const isDisabled = ref(false)
+
+const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
import {
getEquipmentTypeApi, //装备类型
getCompanyListApi, //所属公司
getEquipmentListApi, //列表
} from 'http/api/usercenter/goodsmang'
-
+import { InfoFilled, UploadFilled } from '@element-plus/icons-vue'
/* 查询参数 */
const queryParams: any = ref({
deviceName: '',
@@ -248,7 +278,8 @@ const queryParams: any = ref({
const addAndEditForm = reactive({
htName: '',
- mainFileList: [],
+ fileInfoList: [],
+ fileInfoTempList: [],
})
// 设备类型树
@@ -295,6 +326,48 @@ const onDialogClose = () => {
// addAndEditFormRef.value.resetFields()
}
+// 自定义事件
+const onFileChange = (fileList: any) => {
+ addAndEditForm.value.fileInfoTempList = []
+ const fileListTemp = fileList.map((e: any) => {
+ return {
+ fileName: e.name,
+ fileUrl: e.url,
+ }
+ })
+
+ addAndEditForm.value.fileInfoTempList.push(...fileListTemp)
+}
+
+const addAndEditFormRules = reactive({
+ htName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }],
+ fileInfoList: [{ required: true, message: '请上传合同附件', trigger: 'blur' }],
+})
+
+// 提交
+const onSubmit = () => {
+ addAndEditForm.value.fileInfoList = addAndEditForm.value.fileInfoTempList
+ addAndEditFormRef.value.validate(async (valid: any) => {
+ if (valid) {
+ // const SEN_API = settleinTitle.value === '合同修改' ? editSafeBookApi : addSafeBookApi
+ // const res: any = await SEN_API(addAndEditForm.value)
+ // if (res.code === 200) {
+ // ElMessage({
+ // type: 'success',
+ // message: '提交成功',
+ // })
+ // dialogVisibleSettlein.value = false
+ // // getLeaseListData()
+ // }
+ }
+ })
+}
+
+// 取消按钮
+const onCancel = () => {
+ dialogVisibleSettlein.value = false
+}
+
onMounted(() => {
// 获取装备树
getTypeTreeData()
diff --git a/src/views/user/goodsManagement/index.vue b/src/views/user/goodsManagement/index.vue
index 27b4b7e..3e1e847 100644
--- a/src/views/user/goodsManagement/index.vue
+++ b/src/views/user/goodsManagement/index.vue
@@ -1481,8 +1481,8 @@ const options = ref([
:span="6"
style="
display: flex;
- justify-content: left;
- align-items: left;
+ justify-content: center;
+ align-items: center;
"
>