From c2cb12bcd295512de34023fd3b0943fc8ab75f34 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 19 八月 2025 09:31:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
h5/pages/reporting_she/reporting_she.vue | 95 ++++++++++++++++++++++++++---------------------
1 files changed, 53 insertions(+), 42 deletions(-)
diff --git a/h5/pages/reporting_she/reporting_she.vue b/h5/pages/reporting_she/reporting_she.vue
index 09798b9..87fcdc9 100644
--- a/h5/pages/reporting_she/reporting_she.vue
+++ b/h5/pages/reporting_she/reporting_she.vue
@@ -7,12 +7,12 @@
<u-form-item label="閮ㄩ棬" labelWidth="120" prop="companyName" borderBottom required>
<u--input v-model="model.companyName" border="none" placeholder="璇烽�夋嫨閮ㄩ棬" disabledColor="#ffffff"
disabled></u--input>
- <u-icon slot="right" name="arrow-right"></u-icon>
+ <!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item>
<u-form-item label="涓婃姤鏃堕棿" labelWidth="120" prop="submitDate" borderBottom required>
<u--input v-model="model.submitDate" border="none" placeholder="璇烽�夋嫨涓婃姤鏃堕棿" disabledColor="#ffffff"
disabled></u--input>
- <u-icon slot="right" name="arrow-right"></u-icon>
+ <!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item>
<u-form-item label="鍙戠敓鏃堕棿" labelWidth="120" prop="happenTime" borderBottom @click="openTime" required>
<u--input v-model="model.happenTime" border="none" placeholder="璇烽�夋嫨鍙戠敓鏃堕棿" disabledColor="#ffffff"
@@ -80,14 +80,13 @@
<u--textarea v-model="model.eventInfo" placeholder="璇疯緭鍏ヤ簨浠惰鏄�" style="margin-top: 15rpx;" maxlength="200" count></u--textarea>
</u-form-item>
<u-form-item label="涓婁紶鍥剧墖" labelWidth="120" prop="multifileList" labelPosition="top" borderBottom>
- <u-upload
+ <UploadImage
:fileList="model.multifileList"
- @afterRead="afterRead"
- @delete="deletePic"
- accept="image"
- multiple
- name="1"
- style="margin-top: 15rpx;"></u-upload>
+ folder="WORKORDER_FILE_PATH"
+ @dele="deletePic"
+ @getFileList="afterRead"
+ style="margin-top: 15rpx;"
+ />
</u-form-item>
</u--form>
<u-button type="primary" text="鎻愪氦" @click="submit" style="margin-top: 60rpx;"></u-button>
@@ -106,7 +105,7 @@
<view class="slot-content">
<u-icon name="checkmark-circle-fill" color="#3875C5" size="70"></u-icon>
<text>鎻愪氦鎴愬姛</text>
- <text>鎰熻阿鎮ㄧ殑鍙嶉</text>
+ <text>宸叉敹鍒版偍鐨勪笂鎶ワ紝绋嶅悗浼氭湁鐩稿叧鍚屼簨鍜屾偍鑱旂郴</text>
</view>
</u-modal>
<!-- 鍙戠敓鍦扮偣 -->
@@ -138,9 +137,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'])
},
@@ -258,6 +258,39 @@
this.getType()
},
methods: {
+ selectImage() {
+ var that = this
+ that.$ww.chooseImage({
+ count: 1,
+ sizeType: ['original', 'compressed'],
+ sourceType: ['album', 'camera'],
+ success(res) {
+ let serverIds = that.getUploadImage(res.localIds)
+ console.log(serverIds)
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+ },
+ // 鑾峰彇鏈嶅姟鍣ㄥ浘鐗噄d
+ getUploadImage(localIds) {
+ var that = this
+ let serverIds = []
+ localIds.forEach(localId => {
+ that.$ww.uploadImage({
+ localId,
+ success(res) {
+ console.log(res.serverId)
+ serverIds.push(res.serverId)
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+ })
+ return serverIds;
+ },
closeTime() {
this.show1 = false
this.canScroll()
@@ -318,6 +351,10 @@
}
},
next() {
+ this.canScroll()
+ this.show4 = false
+ },
+ next1() {
this.model.name = ''
this.model.submitDate = uni.$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd hh:MM')
this.model.companyName = ''
@@ -339,8 +376,6 @@
this.model.multifileList = []
this.model.fileList = []
this.model.type = 0
- this.canScroll()
- this.show4 = false
},
toDesc() {
uni.navigateTo({
@@ -350,37 +385,12 @@
this.show4 = false
},
// 鍒犻櫎鍥剧墖
- 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) {
- var that = this
- uni.showLoading({ title: '涓婁紶涓�...', mask: true })
- uni.uploadFile({
- url: this.$baseUrl + '/web/public/uploadBatch',
- files: event.file.map(e => {
- return { name: 'files', uri: e.url }
- }),
- formData: {
- folder: "WORKORDER_FILE_PATH",
- },
- success(res) {
- uni.hideLoading();
- let obj = JSON.parse(res.data)
- if (obj.code === 200) {
- console.log(obj.data)
- obj.data.forEach(item => {
- item.fileurl = item.imgaddr
- })
- that.model.multifileList = [...that.model.multifileList, ...obj.data]
- }
- }
- })
+ async afterRead(arr) {
+ this.model.multifileList = [...this.model.multifileList, ...arr]
},
// 鎻愪氦
submit() {
@@ -391,6 +401,7 @@
form.happenTime = form.happenTime + ':00'
let res = await that.$u.api.workOrderCreate(form)
if (res.code === 200) {
+ that.next1()
that.id = res.data
this.stopScroll()
that.show4 = true
--
Gitblit v1.9.3