diff --git a/components/task/AttachmentFileUploader.vue b/components/task/AttachmentFileUploader.vue
index a423f09..ff4a2a7 100644
--- a/components/task/AttachmentFileUploader.vue
+++ b/components/task/AttachmentFileUploader.vue
@@ -1,6 +1,6 @@
-
+
{{ icon }}
{{ title }}
›
@@ -18,7 +18,7 @@
class="preview-image"
@click="previewImage(index)"
/>
- ✕
+ ✕
@@ -37,7 +37,7 @@
{{ formatFileSize(file.size) }}
{{ getFileIcon(file.name) }}
- ✕
+ ✕
@@ -67,6 +67,10 @@ const props = defineProps({
extensions: {
type: Array,
default: () => ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.txt', '.zip', '.rar', '.jpg', '.png']
+ },
+ readonly: {
+ type: Boolean,
+ default: false
}
});
@@ -90,8 +94,12 @@ const isImageFile = (file) => {
const imageFiles = computed(() => files.value.filter((file) => isImageFile(file)));
const otherFiles = computed(() => files.value.filter((file) => !isImageFile(file)));
+const isReadonly = computed(() => props.readonly);
const handleChooseFiles = async () => {
+ if (isReadonly.value) {
+ return;
+ }
const remainingCount = props.maxCount - files.value.length;
if (remainingCount <= 0) {
uni.showToast({
@@ -283,6 +291,7 @@ const uploadFiles = async (fileList) => {
};
const removeFile = (file) => {
+ if (isReadonly.value) return;
const next = files.value.filter((item) => item !== file);
files.value = next;
};
@@ -439,6 +448,14 @@ const previewFile = (file) => {
&:active {
background-color: #f5f5f5;
}
+
+ &.disabled {
+ cursor: default;
+ opacity: 0.6;
+ &:active {
+ background-color: inherit;
+ }
+ }
}
.form-icon {
diff --git a/pages.json b/pages.json
index 926642b..9a4c3d0 100644
--- a/pages.json
+++ b/pages.json
@@ -159,7 +159,7 @@
{
"path": "pages/project/form/index",
"style": {
- "navigationBarTitleText": "项目编辑"
+ "navigationBarTitleText": "项目操作"
}
},
diff --git a/pages/project/form/index.vue b/pages/project/form/index.vue
index c3c07f2..132ad02 100644
--- a/pages/project/form/index.vue
+++ b/pages/project/form/index.vue
@@ -19,6 +19,27 @@
+
基本信息
@@ -28,6 +49,7 @@
@@ -38,6 +60,7 @@
@@ -50,13 +73,14 @@
class="form-input"
v-model="formData.amount"
type="digit"
+ :disabled="isViewMode"
placeholder="请输入金额"
placeholder-style="color:#999;"
/>
到账时间
-
+
{{ formData.expireTime || '请选择日期' }}
›
@@ -65,7 +89,7 @@
客户
-
+
{{ formData.customerName || '请选择客户' }}
›
@@ -76,6 +100,7 @@
@@ -86,6 +111,7 @@
@@ -108,6 +134,7 @@
class="form-input"
type="digit"
v-model="formData[item.amountKey]"
+ :disabled="isViewMode"
placeholder="请输入金额"
placeholder-style="color:#999;"
/>
@@ -116,6 +143,7 @@
收款时间
{{ formData[item.dateKey] || '请选择日期' }}
@@ -132,6 +160,7 @@
@@ -142,7 +171,12 @@
@@ -151,7 +185,7 @@
序号
成员
角色
- 操作
+ 操作
-
+
删除
@@ -202,7 +240,7 @@
-
+
-
+