瀏覽代碼

工单处理移动端代码

user5 8 月之前
父節點
當前提交
6bdcfcff34

+ 8 - 0
api/garbageClearance/disposeRubbishService.js

@@ -51,4 +51,12 @@ export default {
 
 		});
 	},
+	getByWorkOverId: function (programIdList) {
+		return request({
+			url: "/dispose/rubbish/getByWorkOverId",
+			method: "get",
+			params: {programIds: programIdList.join(",")},
+
+		});
+	},
 };

+ 10 - 0
api/garbageClearance/overService.js

@@ -64,5 +64,15 @@ export default {
 				attachmentFlag: attachmentFlag
 			},
 		});
+	},
+	getPhotoListByIdAndAttachmentFlag: function (ids, attachmentFlag) {
+		return request({
+			url: "/look/over/getPhotoListByIdAndAttachmentFlag",
+			method: "get",
+			params: {
+				ids: ids,
+				attachmentFlag: attachmentFlag
+			},
+		});
 	}
 };

+ 3 - 3
pages/apps/notification/notificationDetail.vue

@@ -32,8 +32,8 @@
 					<u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="处理单位" clearable></u--input>
 				</u-form-item>
 
-				<u-form-item label="清运专员" prop="clearUserName">
-					<u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+				<u-form-item label="村负责人" prop="clearUserName">
+					<u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
 				</u-form-item>
 
 				<u-form-item label="联系方式" prop="clearUserMobile">
@@ -113,7 +113,7 @@
 				}
 				// 获取巡视工单信息
 				await overService.queryById(data.lookOverId).then((data) => {
-					data.no = 'XS-J' + data.no;
+					//data.no = 'XS-J' + data.no;
 					this.fileList1 = data.fileList1
 					this.inputForm = this.recover(this.inputForm, data)
 				})

+ 100 - 59
pages/edt/DisposeRubbishForm.vue

@@ -18,8 +18,8 @@
                     <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="所属单位" clearable></u--input>
                 </u-form-item>
 
-                <u-form-item label="清运专员" prop="clearUserName">
-                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+                <u-form-item label="村负责人" prop="clearUserName">
+                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
                 </u-form-item>
 
                 <u-form-item label="联系方式" prop="clearUserMobile">
@@ -47,10 +47,27 @@
                                 :required="true"
                                 :prop="'workOverNoList[' + index_workOver + '].no'"
                         >
-                            <u--input v-model="inputForm.workOverNoList[index_workOver].no"  placeholder="请选择巡视工单编号" @focus="showWorkOver(index_workOver)" clearable></u--input>
-
-                            <u-button type="error" style="width: 20%" text="删除" @click="removeRow(index_workOver)"></u-button>
+                            <div style="width: 100%">
+                                <u--input v-model="inputForm.workOverNoList[index_workOver].no"  placeholder="请选择巡视工单编号" @focus="showWorkOver(index_workOver)" clearable></u--input>
+
+                                <view >
+                                    <text class="u-demo-block__title">{{inputForm.workOverNoList[index_workOver].no}}清理前照片</text>
+                                    <view class="u-page__upload-item">
+                                        <u-upload
+                                                :disabled="true"
+                                                :fileList="getFileList(index_workOver)"
+                                                @afterRead="afterRead"
+                                                name="1"
+                                                multiple
+                                                :maxCount="10"
+                                        ></u-upload>
+                                    </view>
+                                </view>
+
+                                <u-button type="error" text="删除" @click="removeRow(index_workOver)"></u-button>
+                            </div>
                         </u-form-item>
+
                     </div>
                 </template>
 
@@ -71,8 +88,8 @@
                     <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="所属单位" clearable></u--input>
                 </u-form-item>
 
-                <u-form-item label="清运专员" prop="clearUserName">
-                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+                <u-form-item label="村负责人" prop="clearUserName">
+                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
                 </u-form-item>
 
                 <u-form-item label="联系方式" prop="clearUserMobile">
@@ -115,7 +132,7 @@
         </view>
 
         <!-- Second Section: 上传图片 -->
-        <view class="form-section">
+        <view class="form-section" v-if="nodeFlag">
             <text class="u-demo-block__title">清理前照片</text>
             <view class="u-page__upload-item">
                 <u-upload
@@ -130,7 +147,7 @@
         </view>
 
         <!-- Second Section: 上传图片 -->
-        <view class="form-section">
+        <view class="form-section" v-if="nodeFlag">
             <text class="u-demo-block__title">清理中照片</text>
             <view class="u-page__upload-item">
                 <u-upload
@@ -145,7 +162,7 @@
         </view>
 
         <!-- Second Section: 上传图片 -->
-        <view class="form-section">
+        <view class="form-section" v-if="nodeFlag">
             <text class="u-demo-block__title">清理后照片</text>
             <view class="u-page__upload-item">
                 <u-upload
@@ -359,6 +376,11 @@
             },
         },
         methods: {
+
+            getFileList(index_workOver) {
+                // 返回当前行的文件列表
+                return this.inputForm.workOverNoList[index_workOver].photos || [];
+            },
             handleInput(field, value) {
                 // Ensure value is a string and sanitize input
                 value = value.toString();
@@ -434,58 +456,54 @@
             }
             ,
             async selectWorkOverChange(rows, index) {
-                if (rows.length > 0) {
-                    rows.forEach((item, rowIndex) => {
-                        const exists = this.inputForm.programIds.includes(item.id);
-                        if(!exists){
-                            this.inputForm.programIds.push(item.id);
-                            if (rowIndex === 0) {
-                                let r = this.inputForm.workOverNoList[index];
-                                if (!r) {
-                                    r = {};
-                                }
-                                r.no = item.no;
-                                this.$set(this.inputForm.workOverNoList, index, r);
-                            } else {
-                                let r = {
-                                    no: item.no
-                                }
-                                this.inputForm.workOverNoList.push(r);
-                            }
-                        }
-                    });
-                } else {
-                    const exists = this.inputForm.programIds.includes(item.id);
-                    if(!exists){
-                        let r = {
-                            no: item.no
-                        }
-                        if (!this.inputForm.detailInfoWorkOvers) {
-                            this.$set(this.inputForm, 'detailInfoWorkOvers', []);
-                        }
-                        this.$set(this.inputForm.detailInfoWorkOvers, index, r);
-                        this.inputForm.programIds.push(rows.id);
+                //判定index所在行是否有数据,若有数据,则需要将数据从programIds 和 workOverNoList 进行删除
+                var flag = false;
+                if(this.inputForm.programIds.length>index ){
+                    var result= this.inputForm.programIds[index]
+                    if(result){
+                        flag = true
                     }
                 }
-                //根据关联的询单id 查询处理前中后的信息进行填充照片
-                const programIdString = this.inputForm.programIds.join(','); // 用逗号分隔
-                await overService.getPhotoListByAttachmentAndFlag(programIdString,'before').then(data => {
-                    this.fileList1 = []
-                    data.forEach(
-                        (item) => {
-                            const newItem = {
-                                attachmentName: item.name,
-                                fileSize: item.size,
-                                url: item.temporaryUrl,
-                                type: item.type,      // 如果不需要,可以不写
-                            };
-                            this.fileList1.push(newItem);
+
+                if (rows.length > 0) {
+                    // 遍历 rows 数组
+                    for (const [rowIndex, item] of rows.entries()) {
+                        if(flag) {
+                            flag = false
+                            this.inputForm.programIds[index] = item.id
                         }
-                    );
-                }).catch(() => {
-                    reject('数据错误');
-                });
 
+                        const uniqueIds = [...new Set([...this.inputForm.programIds, item.id])];
+
+                        // 更新 programIds 数组
+                        this.inputForm.programIds = uniqueIds;
+                        console.log(this.inputForm.programIds)
+                    }
+
+                    const programIdString = this.inputForm.programIds.join(','); // 用逗号分隔
+                    await overService.getPhotoListByIdAndAttachmentFlag(programIdString,'before').then(data => {
+                        this.inputForm.workOverNoList = [];
+                        // 将数据填充到 workOverNoList
+                        data.forEach((item) => {
+                            // 创建新的工作项
+                            let workOverItem = { no: item.no };
+
+                            // 处理 fileList1 数据
+                            if (item.fileList1) {
+                                workOverItem.photos = item.fileList1.map(file => ({
+                                    url: file.temporaryUrl,
+                                    type: file.type
+                                }));
+                            }
+
+                            // 将新的工作项添加到 workOverNoList
+                            this.inputForm.workOverNoList.push(workOverItem);
+                        });
+                    }).catch(() => {
+                        reject('数据错误');
+                    });
+
+                }
 
             },
 
@@ -562,7 +580,30 @@
 
             removeRow(index) {
                 // 点击删除按钮时,从表格中移除指定行
+                this.inputForm.programIds.splice(index, 1);
                 this.inputForm.workOverNoList.splice(index, 1);
+                //重新获取巡视工单信息
+                this.insertRefreshPhoto()
+            },
+
+            //刷信photo获取对应的id
+            insertRefreshPhoto() {
+                disposeRubbishService.getByWorkOverId(this.inputForm.programIds).then((data) => {
+                    if (data) {
+                        this.fileList1 = []
+                        data.forEach(
+                            (item) => {
+                                const newItem = {
+                                    attachmentName: item.name,
+                                    fileSize: item.size,
+                                    url: item.temporaryUrl,
+                                    type: item.type,      // 如果不需要,可以不写
+                                };
+                                this.fileList1.push(newItem);
+                            }
+                        );
+                    }
+                })
             },
 
             formatDate(date) {
@@ -702,7 +743,7 @@
                                 // 延迟1秒后再跳转到上一页
                                 setTimeout(() => {
                                     this.isProcessing = false; // 显示遮罩层
-                                    callback(data.businessTable, data.businessId,this.inputForm.disposeType);
+                                    callback(data.businessTable, data.businessId,this.inputForm,this.inputForm.disposeType);
                                     uni.navigateBack({
                                         delta: 1
                                     });

+ 2 - 2
pages/edt/DisposeRubbishFormDetail.vue

@@ -16,8 +16,8 @@
                     <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="所属单位" clearable></u--input>
                 </u-form-item>
 
-                <u-form-item label="清运专员" prop="clearUserName">
-                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+                <u-form-item label="村负责人" prop="clearUserName">
+                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
                 </u-form-item>
 
                 <u-form-item label="联系方式" prop="clearUserMobile">

+ 410 - 0
pages/edt/PatrolWorkOrderAuditForm.vue

@@ -0,0 +1,410 @@
+<template>
+    <view>
+        <cu-custom :backUrl="'/pages/index/index?id=apps'" :isBack="true" bgColor="bg-gradual-blue" v-if="!nodeFlag">
+            <block slot="content">建筑垃圾巡视</block>
+        </cu-custom>
+
+        <!-- First Section: 巡视工单 to 联系方式 -->
+        <view class="form-section">
+            <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm">
+
+                <u-form-item label="巡视工单" prop="no">
+                    <u--input v-model="inputForm.no" :disabled="true" placeholder="工单编号" clearable></u--input>
+                </u-form-item>
+
+                <u-form-item label="处理单位" borderBottom prop="processingUnit" :required="true" v-if="!disFlag">
+                    <jp-picker v-model="inputForm.processingUnit" rangeKey="label" rangeValue="value" :range="processingUnits" @input="getOfficeOnHamlet"></jp-picker>
+                </u-form-item>
+
+                <u-form-item label="处理单位" borderBottom prop="processingUnitName" :required="true" v-else-if="disFlag">
+                    <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="处理单位" clearable></u--input>
+                </u-form-item>
+
+                <u-form-item label="村负责人" prop="clearUserName">
+                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
+                </u-form-item>
+
+                <u-form-item label="联系方式" prop="clearUserMobile">
+                    <u--input v-model="inputForm.clearUserMobile" :disabled="true" placeholder="联系方式" clearable></u--input>
+                </u-form-item>
+
+            </u--form>
+        </view>
+
+        <!-- Second Section: 上传图片 -->
+        <view class="form-section">
+            <text class="u-demo-block__title">清理前照片</text>
+            <view class="u-page__upload-item">
+                <u-upload
+                        :disabled="true"
+                        :fileList="fileList1"
+                        name="1"
+                        multiple
+                        :maxCount="10"
+                ></u-upload>
+            </view>
+        </view>
+
+        <!-- Third Section: 备注 -->
+        <view class="form-section">
+            <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm">
+                <u-form-item label="备注" borderBottom prop="remarks">
+                    <u--textarea placeholder='请填写备注' :maxlength="500" :disabled="true" v-model="inputForm.remarks"></u--textarea>
+                </u-form-item>
+            </u--form>
+        </view>
+    </view>
+</template>
+
+<script>
+    import overService from '@/api/garbageClearance/overService'
+    import {mapState, mapMutations, mapActions} from 'vuex'
+    import * as $auth from "../../common/auth";
+    import { EventBus } from '@/store/eventBus.js';
+    import taskService from "@/api/flowable/taskService"
+    export default {
+        components: {
+        },
+        computed: mapState({
+            userInfo: (state) => state.user.userInfo,
+            avatar: (state) => state.user.avatar
+        }),
+        data () {
+            return {
+                disFlag: true,  // 启用动态获取处理单位则设置为false
+                isProcessing: false,  // 遮罩层
+                processingUnits: [],
+                fileList1: [],
+                fileList2: [],
+                fileList3: [],
+                nodeFlag: false,
+                inputForm: {
+                    id: '',
+                    no: '',
+                    processingUnit: '',
+                    processingUnitName: '',
+                    clearUserId: '',
+                    clearUserName: '',
+                    clearUserMobile: '',
+                    remarks: '',
+                },
+                rules: {
+                    'processingUnit': [
+                        {
+                            required: true,
+                            message: '处理单位不能为空',
+                            trigger: ['blur', 'change']
+                        }
+                    ],
+                }
+            }
+        },
+        // 页面加载时执行
+        async created() {
+            if('乡镇巡查员' === this.userInfo.roleNames){
+                this.disFlag = false
+                // 不动态获取  根据当前登录人去查
+                await overService.getOfficeOnHamlet()
+                    .then(data => {
+                        this.processingUnits = []
+                        for (const value of data) {
+                            this.processingUnits.push({
+                                label: value.officeName,
+                                value: value.officeId
+                            });
+                        }
+                    })
+                    .catch(e => {
+                        throw e;
+                    });
+            }
+            if(!this.nodeFlag){
+                let data = await overService.getMaxNo();
+                this.inputForm.no = data;
+                /*if (data) {
+                    let newNo = parseInt(data, 10) + 1;
+                    this.inputForm.no = 'XS-J' + newNo;
+                } else {
+                    // 获取当前年份
+                    let nowY = new Date().getFullYear();
+                    this.inputForm.no = 'XS-J' + nowY + '0001';
+                }*/
+
+                // 如果要使用动态获取处理单位则设置为true
+                if (false) {
+                    let units = await overService.getProcessingUnit();
+                    let childs = units[0].children;
+
+                    if (childs) {
+                        this.processingUnits = [];  // 初始化数组
+
+                        for (let i = 0; i < childs.length; i++) {
+                            this.processingUnits.push({
+                                label: childs[i].name,
+                                value: childs[i].id
+                            });
+                        }
+                    }
+                }
+
+                this.inputForm.processingUnit = this.userInfo.officeDTO.id
+                this.inputForm.processingUnitName = this.userInfo.officeDTO.name
+                // 不动态获取  根据当前登录人去查
+                await overService.getUserInfoByOffId(this.userInfo.officeDTO.id)
+                    .then(data => {
+                        this.inputForm.clearUserId = data.id
+                        this.inputForm.clearUserName = data.name
+                        this.inputForm.clearUserMobile = data.mobile
+                    })
+                    .catch(e => {
+                        throw e;
+                    });
+            }
+
+
+
+        },
+        props: {
+            businessId: {
+                type: String,
+                default: ''
+            },
+            formReadOnly: {
+                type: Boolean,
+                default: false
+            },
+            status: {
+                type: String,
+                default: ''
+            }
+        },
+        watch: {
+            'businessId': {
+                handler (newVal) {
+                    if (this.businessId) {
+                        this.init(this.businessId)
+                    } else {
+                        this.$nextTick(() => {
+                            // this.$refs.inputForm.reset()
+                        })
+                    }
+                },
+                immediate: true,
+                deep: false
+            },
+        },
+        onLoad(options) {
+            // 从 options 中获取 id 参数
+            this.id = options.id;
+            // 这里可以调用初始化方法
+            this.init(this.id);
+        },
+        methods: {
+            async init (id) {
+                if(id){
+                    this.nodeFlag = true
+                    this.inputForm.id = id
+                    if (id) {
+
+                        const data =  await overService.queryById(id);
+                        console.log(data)
+                        this.inputForm = this.recover(this.inputForm, data)
+                        // 处理文件列表
+                        if (data.beforeFileList) {
+                            this.fileList1 = data.beforeFileList.map(item => ({
+                                attachmentName: item.name,
+                                fileSize: item.size,
+                                url: item.temporaryUrl,
+                                type: item.type // 如果不需要,可以不写
+                            }));
+                        }
+
+                        if (data.betweenFileList) {
+                            this.fileList2 = data.betweenFileList.map(item => ({
+                                attachmentName: item.name,
+                                fileSize: item.size,
+                                url: item.temporaryUrl,
+                                type: item.type // 如果不需要,可以不写
+                            }));
+                        }
+
+                        if (data.afterFileList) {
+                            this.fileList3 = data.afterFileList.map(item => ({
+                                attachmentName: item.name,
+                                fileSize: item.size,
+                                url: item.temporaryUrl,
+                                type: item.type // 如果不需要,可以不写
+                            }));
+                        }
+                    }
+                }
+
+            },
+            formatDate(date) {
+                const dateNew = new Date(date); // 将日期字符串转换为 Date 对象
+                const year = dateNew.getFullYear();
+                const month = (dateNew.getMonth() + 1).toString().padStart(2, '0');
+                const day = dateNew.getDate().toString().padStart(2, '0');
+                return `${year}-${month}-${day}`;
+            },
+            isEmpty(value) {
+                let result = false;
+                if (value == null || value == undefined) {
+                    result = true;
+                }
+                if (typeof value == 'string' && (value.replace(/\s+/g, "") == "" || value == "")) {
+                    result = true;
+                }
+                if (typeof value == "object" && value instanceof Array && value.length === 0) {
+                    result = true;
+                }
+                return result;
+            },
+            isNotEmpty (value) {
+                return !this.isEmpty(value)
+            },
+            /**
+             * 判断是否为空
+             */
+            isNull(val) {
+                if (val instanceof Array) {
+                    if (val.length === 0) return true;
+                } else if (val instanceof Object) {
+                    if (JSON.stringify(val) === "{}") return true;
+                } else {
+                    if (
+                        val === "null" ||
+                        val == null ||
+                        val === "undefined" ||
+                        val === undefined ||
+                        val === ""
+                    )
+                        return true;
+                    return false;
+                }
+                return false;
+            },
+
+            formatDateNew(date) {
+                const year = date.getFullYear();
+                const month = (date.getMonth() + 1).toString().padStart(2, '0');
+                const day = date.getDate().toString().padStart(2, '0');
+                const hours = date.getHours().toString().padStart(2, '0');
+                const minutes = date.getMinutes().toString().padStart(2, '0');
+                const seconds = date.getSeconds().toString().padStart(2, '0');
+
+                return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+            },
+            saveForm(callback) {
+                this.isProcessing = true; // 显示遮罩层
+
+                return new Promise((resolve, reject) => {
+                    // 表单规则验证
+                    // ...
+
+                    let errors = [];
+
+                    if (this.fileList1 && this.fileList1.length > 0) {
+                        // 将 fileList1 中的每个文件对象的属性名调整为新的属性名
+                        this.inputForm.fileList1 = this.fileList1.map(file => {
+                            return {
+                                attachmentName: file.name,
+                                fileSize: file.size,
+                                url: file.url,
+                                type: file.type,      // 如果不需要,可以不写
+                                attachmentFlag: 'before',      // 如果不需要,可以不写
+                            };
+                        });
+                    }
+
+                    if (errors.length > 0) {
+                        // 存在错误,显示提示信息
+                        errors.forEach(error => {
+                            uni.showToast({
+                                title: error,
+                                icon: 'none',
+                                duration: 2000
+                            });
+                        });
+                        this.isProcessing = false;
+                        reject('Form validation failed');
+                    } else {
+                        // 所有验证通过,执行保存操作
+                        this.$refs.inputForm.validate().then(() => {
+                            uni.showLoading();
+
+                            this.inputForm.status = '5'
+                            overService.save(this.inputForm).then(data => {
+
+                                uni.showToast({
+                                    title: "提交成功",
+                                    icon: "success",
+                                    duration: 1000  // 提示持续时间为1秒(1000毫秒)
+                                });
+
+                                // 延迟1秒后再跳转到上一页
+                                setTimeout(() => {
+                                    this.isProcessing = false; // 显示遮罩层
+                                    callback(data.businessTable, data.businessId);
+                                    resolve('Form saved successfully');
+                                    uni.navigateBack({
+                                        delta: 1
+                                    });
+                                }, 1000);
+                            }).catch(error => {
+                                reject('Save operation failed');
+                            });
+                        }).catch(() => {
+                            reject('Form validation failed');
+                        });
+                    }
+                });
+            },
+            getOfficeOnHamlet(value){
+                // 根据组织ID 获取 该村的 村支书
+                overService.getUserInfoByOffId(value)
+                    .then(data => {
+                        this.inputForm.clearUserId = data.id
+                        this.inputForm.clearUserName = data.name
+                        this.inputForm.clearUserMobile = data.mobile
+                    })
+                    .catch(e => {
+                        throw e;
+                    });
+            }
+        }
+    }
+</script>
+
+<style>
+    .form-section {
+        padding: 10px 15px;
+        margin-bottom: 10px;
+        background-color: #ffffff;
+        border-radius: 5px;
+        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
+    }
+
+    .u-page__upload-item {
+        margin-top: 10px;
+    }
+
+    .button-container {
+        margin-top: 20px;
+        text-align: center;
+    }
+
+    .cu-form-group .title {
+        min-width: 100px;
+    }
+    /* 遮罩层样式 */
+    .mask {
+        position: fixed;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        background-color: rgba(0, 0, 0, 0.05); /* 半透明遮罩 */
+        z-index: 9999; /* 确保遮罩层在最顶层 */
+    }
+</style>

+ 5 - 4
pages/edt/PatrolWorkOrderDisposeForm.vue

@@ -20,8 +20,8 @@
                     <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="处理单位" clearable></u--input>
                 </u-form-item>
 
-                <u-form-item label="清运专员" prop="clearUserName">
-                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+                <u-form-item label="村负责人" prop="clearUserName">
+                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
                 </u-form-item>
 
                 <u-form-item label="联系方式" prop="clearUserMobile">
@@ -106,14 +106,15 @@
         async created() {
 
             let data = await overService.getMaxNo();
-            if (data) {
+            this.inputForm.no = data;
+            /*if (data) {
                 let newNo = parseInt(data, 10) + 1;
                 this.inputForm.no = 'XS-J' + newNo;
             } else {
                 // 获取当前年份
                 let nowY = new Date().getFullYear();
                 this.inputForm.no = 'XS-J' + nowY + '0001';
-            }
+            }*/
 
             // 如果要使用动态获取处理单位则设置为true
             if (false) {

+ 33 - 8
pages/edt/PatrolWorkOrderForm.vue

@@ -20,8 +20,8 @@
                     <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="处理单位" clearable></u--input>
                 </u-form-item>
 
-                <u-form-item label="清运专员" prop="clearUserName">
-                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+                <u-form-item label="村负责人" prop="clearUserName">
+                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
                 </u-form-item>
 
                 <u-form-item label="联系方式" prop="clearUserMobile">
@@ -43,8 +43,8 @@
                     <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="处理单位" clearable></u--input>
                 </u-form-item>
 
-                <u-form-item label="清运专员" prop="clearUserName">
-                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+                <u-form-item label="村负责人" prop="clearUserName">
+                    <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
                 </u-form-item>
 
                 <u-form-item label="联系方式" prop="clearUserMobile">
@@ -136,14 +136,14 @@
                     <u--textarea placeholder='请填写备注' :maxlength="500" v-model="inputForm.remarks"></u--textarea>
                 </u-form-item>
 
-                <view class="button-container">
+                <!--<view class="button-container">
                     <u-button
                             text="提交"
                             size="large"
                             type="primary"
                             @click="saveForm"
                     ></u-button>
-                </view>
+                </view>-->
                 <!-- 遮罩层 -->
                 <view v-if="isProcessing" class="mask"></view>
             </u--form>
@@ -230,14 +230,15 @@
             }
             if(!this.nodeFlag){
                 let data = await overService.getMaxNo();
-                if (data) {
+                this.inputForm.no = data;
+                /*if (data) {
                     let newNo = parseInt(data, 10) + 1;
                     this.inputForm.no = 'XS-J' + newNo;
                 } else {
                     // 获取当前年份
                     let nowY = new Date().getFullYear();
                     this.inputForm.no = 'XS-J' + nowY + '0001';
-                }
+                }*/
 
                 // 如果要使用动态获取处理单位则设置为true
                 if (false) {
@@ -274,12 +275,33 @@
 
         },
         props: {
+            businessId: {
+                type: String,
+                default: ''
+            },
+            formReadOnly: {
+                type: Boolean,
+                default: false
+            },
             status: {
                 type: String,
                 default: ''
             }
         },
         watch: {
+            'businessId': {
+                handler (newVal) {
+                    if (this.businessId) {
+                        this.init(this.businessId)
+                    } else {
+                        this.$nextTick(() => {
+                            // this.$refs.inputForm.reset()
+                        })
+                    }
+                },
+                immediate: true,
+                deep: false
+            },
         },
         onLoad(options) {
             // 从 options 中获取 id 参数
@@ -444,6 +466,7 @@
                         this.$refs.inputForm.validate().then(() => {
                             uni.showLoading();
 
+                            this.inputForm.status = '2'
                             overService.save(this.inputForm).then(data => {
 
                                 uni.showToast({
@@ -455,6 +478,8 @@
                                 // 延迟1秒后再跳转到上一页
                                 setTimeout(() => {
                                     this.isProcessing = false; // 显示遮罩层
+                                    this.inputForm.assignee = this.inputForm.clearUserId
+                                    callback(data.businessTable, data.businessId,this.inputForm);
                                     resolve('Form saved successfully');
                                     uni.navigateBack({
                                         delta: 1

+ 11 - 4
pages/edt/WorkOverChoose.vue

@@ -6,10 +6,19 @@
                 <view class="action text-green" @tap="selectUsers">确定</view>
             </view>
             <view style="max-height: 300px; overflow-y: auto;">
+                <!-- 标题行 -->
+                <view style="padding: 10px; font-weight: bold; display: flex; align-items: center;">
+                    <view style="flex: 1;text-align: left;">工单编号</view>
+                    <view style="flex: 1;text-align: left;">创建时间</view>
+                    <view style="flex: 1;text-align: left;">备注</view>
+                </view>
                 <view v-for="item in data" :key="item.id" style="padding: 10px;">
                     <view @tap="onItemClick(item)" style="display: flex; align-items: center;">
-                        <view style="flex: 1;text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ item.no }}</view>
+                        <view style="flex: 1;text-align: left; ">{{ item.no }}</view>
+                        <view style="flex: 1;text-align: left; ">{{ item.showCreateTime }}</view>
+                        <view style="flex: 1;text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ item.remarks }}</view>
                         <view v-if="item.checked" style="color: #409eff;">已选择</view>
+                        <!--<view v-if="item.checked" style="color: #409eff;">✔</view>-->
                     </view>
                 </view>
             </view>
@@ -98,13 +107,11 @@
             },
             loadData() {
                 this.loading = true; // 开始加载数据,显示loading状态
-                console.log(3213123)
-                overService.getNotDisposeList({ status: 1, current: this.currentPage, pageSize: this.pageSize })
+                overService.getNotDisposeList({ disposeStatus: 1, current: this.currentPage, pageSize: this.pageSize })
                     .then(data => {
                         this.loading = false; // 数据加载完成,隐藏loading状态
                         // 检查新返回的数据是否已经存在,如果存在,则不添加到原始数据数组中
                         let newData = data.records.filter(record => !this.data.some(item => item.id === record.id));
-                        console.log(newData)
                         if (this.currentPage === 1) {
                             // 如果是加载第一页,则直接赋值给 data
                             this.data = newData.map(item => ({ ...item, checked: false }));

+ 5 - 0
pages/login/login.vue

@@ -33,6 +33,7 @@
 							<u-button type="primary" class="send" @click="getLoginPushPhoneCode" style="background-color: #3595f9; width: 100px;" :disabled="loginCounting">{{ loginCounting ? `请等待${loginCount}秒` : '获取验证码' }}</u-button>
 
 						</u-form-item>
+					<span class="count" style="color: #8f939c">{{this.randomCode}}</span>
 						<!--<u-form-item label="密码" borderBottom prop="password">
 							<u-input border="none" password v-model="inputForm.password" />
 						</u-form-item>
@@ -110,6 +111,7 @@
 				timer: null, // 定时器
 				showLoginPhoneCode: true,
 				captchaImg: '',
+				randomCode: '',
 				inputForm: {
 					'username': '',
 					'password': '',
@@ -241,11 +243,14 @@
 				this.whichPage = '1' // 打开登录页面
 			},
 			getLoginPushPhoneCode () {
+				this.randomCode = ""
 				// 验证手机号码格式是否正确
 				if (this.isNotEmpty(this.inputForm.username) && this.checkLoginMobile(this.inputForm.username)) {
 					// 向手机号发送验证码
 					loginService.getLoginPhoneCode(this.inputForm.username).then((data) => {
 						if (data.success) {
+							var randomCode = data.randomCode
+							this.randomCode = "您本次登录的验证码为:" + randomCode
 							uni.showToast({ title: data.message, icon: "success" });
 
 							this.loginCounting = true;

+ 17 - 5
pages/workbench/task/TaskForm.vue

@@ -10,7 +10,9 @@
 		<view v-show="0 === tabIndex">
 			<scroll-view scroll-y>
 			<view class=" bg-white ">
-				
+
+				<PatrolWorkOrderForm  v-if="formUrl.endsWith('PatrolWorkOrderForm')" :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId"></PatrolWorkOrderForm>
+				<PatrolWorkOrderAuditForm  v-if="formUrl.endsWith('PatrolWorkOrderAuditForm')" :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId"></PatrolWorkOrderAuditForm>
 				<TestActivitiLeaveForm  v-if="formUrl.endsWith('TestActivitiLeaveForm')" :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId"></TestActivitiLeaveForm>
 				<DisposeRubbishForm  v-if="formUrl.endsWith('DisposeRubbishForm')" :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId"></DisposeRubbishForm>
 				  <!-- <component :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId" :is="form"></component> -->
@@ -96,6 +98,8 @@
 	import TaskBackNodes from './components/TaskBackNodes.vue'
 	import TestActivitiLeaveForm from '@/pages/test/activiti/TestActivitiLeaveForm.vue'
 	import DisposeRubbishForm from '@/pages/edt/DisposeRubbishForm.vue'
+	import PatrolWorkOrderForm from '@/pages/edt/PatrolWorkOrderForm.vue'
+	import PatrolWorkOrderAuditForm from '@/pages/edt/PatrolWorkOrderAuditForm.vue'
 	import moment from 'moment'
 	import taskService from "@/api/flowable/taskService"
 	import formService from "@/api/flowable/formService"
@@ -135,10 +139,12 @@
 				  // uniapp 不支持动态组件,所以通过名称匹配决定调用的表单组件
 				  if(this.formUrl.endsWith('TestActivitiLeaveForm')){ 
 					  this.form = TestActivitiLeaveForm
-				  }
-				  // uniapp 不支持动态组件,所以通过名称匹配决定调用的表单组件
-				  if(this.formUrl.endsWith('DisposeRubbishForm')){
+				  }else if(this.formUrl.endsWith('DisposeRubbishForm')){
 					  this.form = DisposeRubbishForm
+				  }else if(this.formUrl.endsWith('PatrolWorkOrderForm')){
+					  this.form = PatrolWorkOrderForm
+				  }else if(this.formUrl.endsWith('PatrolWorkOrderAuditForm')){
+					  this.form = PatrolWorkOrderAuditForm
 				  }else{
 					  uni.showToast({ title: '没有关联流程表单!', icon: "none" });
 				  }
@@ -195,6 +201,8 @@
 		  userSelectDialog,
 		  TestActivitiLeaveForm,
 		  DisposeRubbishForm,
+		  PatrolWorkOrderForm,
+		  PatrolWorkOrderAuditForm,
 		  TaskBackNodes,
 		  PreviewForm
 		},
@@ -344,7 +352,11 @@
 			// 启动流程
 			start (vars) {
 			  if (this.formType === '2') { // 外置表单启动
-				this.$refs.form.saveForm((businessTable, businessId,disposeType) => {
+				this.$refs.form.saveForm((businessTable, businessId,inputForm,disposeType) => {
+					console.log(inputForm)
+					if(inputForm.assignee){
+						this.auditForm.assignee = inputForm.assignee
+					}
 				  taskService.start({
 					procDefKey: this.procDefKey,
 					businessTable: businessTable,

+ 8 - 0
pages/workbench/task/TaskFormDetail.vue

@@ -57,6 +57,8 @@
 	import PreviewForm from '../form/GenerateFlowableForm'
 	import TestActivitiLeaveForm from '@/pages/test/activiti/TestActivitiLeaveForm.vue'
 	import DisposeRubbishForm from '@/pages/edt/DisposeRubbishFormDetail.vue'
+	import PatrolWorkOrderForm from '@/pages/edt/PatrolWorkOrderForm.vue'
+	import PatrolWorkOrderAuditForm from '@/pages/edt/PatrolWorkOrderAuditForm.vue'
 	import taskService from "@/api/flowable/taskService"
 	import formService from "@/api/flowable/formService"
 	export default {
@@ -88,6 +90,10 @@
 						this.form = TestActivitiLeaveForm
 					}else if(this.formUrl.endsWith('DisposeRubbishForm')){
 						this.form = DisposeRubbishForm
+					}else if(this.formUrl.endsWith('PatrolWorkOrderForm')){
+						this.form = PatrolWorkOrderForm
+					}else if(this.formUrl.endsWith('PatrolWorkOrderAuditForm')){
+						this.form = PatrolWorkOrderAuditForm
 					}else{
 						uni.showToast({ title: '没有关联流程表单!', icon: "none" });
 					}
@@ -126,6 +132,8 @@
 		  userSelect,
 		  TestActivitiLeaveForm,
 		  DisposeRubbishForm,
+		  PatrolWorkOrderForm,
+		  PatrolWorkOrderAuditForm,
 		  PreviewForm
 		},
 		data() {

+ 18 - 2
pages/workbench/workbench.vue

@@ -180,7 +180,8 @@
 
 		<!-- 页脚区域 -->
 		<view class="footer-div">
-			<u-button v-if="userInfo.roleNames == '巡视员' || userInfo.roleNames == '乡镇巡查员' " type="primary" text="巡视工单" @click="openPatrolWorkOrderForm()"></u-button>
+			<!--<u-button v-if="userInfo.roleNames == '巡视员' || userInfo.roleNames == '乡镇巡查员' " type="primary" text="巡视工单" @click="openPatrolWorkOrderForm()"></u-button>-->
+			<u-button v-if="userInfo.roleNames == '巡视员' || userInfo.roleNames == '乡镇巡查员' " type="primary" text="巡视工单" @click="start()"></u-button>
 			<u-button v-if="userInfo.roleNames == '村负责人' " type="primary" text="清运工单" @click="start()"></u-button>
 		</view>
 	</view>
@@ -317,7 +318,10 @@
 
 				// 直接通过 this.userInfo 访问 userInfo 中的属性
 				// 如果 userInfo 存在,继续执行原来的逻辑
-				const roleNames = this.userInfo.roleNames;
+				let roleNames = this.userInfo.roleNames;
+				if(this.userInfo && this.userInfo.roleNames){
+					roleNames = this.userInfo.roleNames;
+				}
 				// 根据从 Vuex 获取的状态来判断样式
 				switch (roleNames) {
 					case '过磅专员':
@@ -670,6 +674,18 @@
 							row = data.records[0].procDef
 						});
 						break;
+					case '巡视员':
+					case '乡镇巡查员':
+						this.sprocessForm.filterText = '巡视工单流程'
+						//根据用户id查询流程id
+						await taskService.getProcessDefIdByRoleName({
+							filter: "processes",
+							modelType: 0,
+							...this.sprocessForm,
+						}).then((data) => {
+							row = data.records[0].procDef
+						});
+						break;
 				}
 				// 读取流程表单
 				taskService.getTaskDef({