From 30e858fa504b268b9b436afca0a1259cf6e8c488 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 19 八月 2025 11:01:40 +0800
Subject: [PATCH] 优化
---
h5/pages/report_dca/report_dca.vue | 89 +++++++++++++++++++++++++++-----------------
1 files changed, 54 insertions(+), 35 deletions(-)
diff --git a/h5/pages/report_dca/report_dca.vue b/h5/pages/report_dca/report_dca.vue
index 4a3cc72..3b9aeff 100644
--- a/h5/pages/report_dca/report_dca.vue
+++ b/h5/pages/report_dca/report_dca.vue
@@ -33,16 +33,17 @@
</view>
</u-form-item>
<u-form-item label="DCA鍥剧墖" labelWidth="120" prop="multifileList" labelPosition="top" borderBottom>
- <u-upload
- :fileList="model.multifileList"
- @afterRead="afterRead"
- @delete="deletePic"
- name="1"
- style="margin-top: 15rpx;" />
+ <UploadImage
+ :fileList="model.multifileList"
+ folder="WORKORDER_FILE_PATH"
+ @dele="deletePic"
+ @getFileList="afterRead"
+ style="margin-top: 15rpx;"
+ />
</u-form-item>
<u-form-item label="閫氱煡浜�" labelWidth="120" prop="notifier" borderBottom required>
- <u--input v-model="model.notifier" border="none" placeholder="璇疯緭鍏ラ�氱煡浜�" disabledColor="#ffffff"
- disabled></u--input>
+ <u--textarea v-model="model.notifier" border="none" placeholder="璇疯緭鍏ラ�氱煡浜�" disabledColor="#ffffff"
+ disabled></u--textarea>
</u-form-item>
</u--form>
<u-button type="primary" text="鎻愪氦" @click="submit" style="margin-top: 60rpx;"></u-button>
@@ -90,9 +91,10 @@
<script>
import { mapState } from 'vuex'
+ import UploadImage from '@/components/uploadImage/uploadImage.vue'
import pengTree from '@/uni_modules/peng-tree/peng-tree/peng-tree.vue'
export default {
- components: { pengTree },
+ components: { pengTree, UploadImage },
computed: {
...mapState(['userInfo'])
},
@@ -163,10 +165,13 @@
time1: new Date().getTime(),
address: [],
theme: [],
- total: 0
+ total: 0,
+ list: []
};
},
onLoad() {
+ this.model.submitDate = uni.$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd hh:MM:ss')
+ this.model.happenTime = uni.$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd hh:MM:ss')
this.model.companyName = this.userInfo.companyName
this.getNotifier()
this.getLocation()
@@ -177,10 +182,17 @@
this.model.dcaYesNum = data.dcaYesNum
this.model.dcaNoNum = data.dcaNoNum
this.model.dcaNoProblemDTOList = data.dcaNoProblemDTOList
+ this.list = data.list
})
},
methods: {
openG() {
+ // this.theme = []
+ this.total = 0
+ this.list = []
+ this.model.dcaYesNum = ''
+ this.model.dcaNoNum = ''
+ this.model.dcaNoProblemDTOList = []
this.stopScroll()
this.show2 = true
},
@@ -191,6 +203,19 @@
next() {
this.canScroll()
this.show6 = false
+ },
+ next1() {
+ this.model.submitDate = ''
+ this.model.happenTime = ''
+ this.model.localtionName = ''
+ this.model.localtionId = ''
+ this.model.typeId = ''
+ this.model.typeName = ''
+ this.model.dcaYesNum = 0
+ this.model.dcaNoNum = 0
+ this.model.dcaNoProblemDTOList = []
+ this.model.multifileList = []
+ this.model.type = 1
},
toDesc() {
this.canScroll()
@@ -203,6 +228,7 @@
async report() {
let res = await this.$u.api.workOrderCreate(this.model)
if (res.code === 200) {
+ this.next1()
this.show4 = false
this.id = res.data
this.show6 = true
@@ -250,38 +276,31 @@
})
return
}
- uni.navigateTo({
- url: `/pages/type_dca/type_dca?theme=${this.model.typeId}&themeName=${this.model.typeName}`
- })
+ if (this.list.length > 0) {
+ uni.setStorageSync('list', this.list);
+ uni.navigateTo({
+ url: `/pages/type_dca/type_dca?theme=${this.model.typeId}&themeName=${this.model.typeName}&disable=1`
+ })
+ } else {
+ uni.navigateTo({
+ url: `/pages/type_dca/type_dca?theme=${this.model.typeId}&themeName=${this.model.typeName}`
+ })
+ }
},
// 鍒犻櫎鍥剧墖
- deletePic(event) {
- this.model.multifileList.forEach((item, index) => {
- if (item.imgaddr === event.file.imgaddr) {
- this.model.multifileList.splice(index, 1)
- }
- })
+ deletePic(index) {
+ this.model.multifileList.splice(index, 1)
},
// 鏂板鍥剧墖
- async afterRead(event) {
- uni.uploadFile({
- url: this.$baseUrl + '/web/public/upload',
- filePath: event.file.url,
- name: "file",
- formData: {
- folder: "WORKORDER_FILE_PATH"
- },
- success: (res) => {
- let obj = JSON.parse(res.data)
- if (obj.code === 200) {
- obj.data.fileurl = obj.data.imgaddr
- this.model.multifileList.push(obj.data)
- }
- }
- });
+ afterRead(arr) {
+ this.model.multifileList = [...this.model.multifileList, ...arr]
},
submit() {
this.$refs.uForm.validate().then(res => {
+ if (this.total === 0) return uni.showToast({
+ title: '璇烽�夋嫨瑙傚療椤�',
+ icon: 'none'
+ })
this.show4 = true
}).catch(errors => {
--
Gitblit v1.9.3