Bläddra i källkod

工单处理移动端代码

user5 8 månader sedan
förälder
incheckning
2687bf9ceb

+ 8 - 1
api/flowable/taskService.js

@@ -2,6 +2,7 @@ import request from "../../common/request"
 
 export default {
   start (params) {
+  	console.log('提交的参数',params)
 		return request({
 			url: "/flowable/task/start",
 			method: "post",
@@ -129,11 +130,17 @@ export default {
 		});
 	},
 	getProcessDefIdByRoleName: function (params) {
-  	console.log(params)
 		return request({
 			url: "/flowable/task/getProcessDefIdByRoleName",
 			method: "get",
 			params: params,
 		});
 	},
+	getTaskNameByProcInsId (procInsId) {
+		return request({
+			url: `/flowable/task/getTaskNameByProcInsId`,
+			method: 'get',
+			params: {procInsId: procInsId}
+		})
+	}
 };

+ 19 - 4
api/garbageClearance/disposeRubbishService.js

@@ -2,30 +2,45 @@ import request from "../../common/request"
 
 export default {
 	save: function (inputForm) {
+		console.log('提交的数据',inputForm)
 		return request({
-			url: "/look/over/save",
+			url: "/dispose/rubbish/save",
 			method: "post",
 			data: inputForm,
 		});
 	},
 
+	queryById: function (id) {
+		return request({
+			url: "/dispose/rubbish/queryById",
+			method: "get",
+			params: { id: id },
+		});
+	},
+
 	getMaxNo: function () {
 		return request({
-			url: "/look/over/getMaxNo",
+			url: "/dispose/rubbish/getMaxNo",
 			method: "get",
 		});
 	},
 	getProcessingUnit: function () {
 		return request({
-			url: "/look/over/getProcessingUnit",
+			url: "/dispose/rubbish/getProcessingUnit",
 			method: "get",
 		});
 	},
 	getUserInfoByOffId: function (officeId) {
 		return request({
-			url: "/look/over/getUserInfoByOffId",
+			url: "/dispose/rubbish/getUserInfoByOffId",
 			method: "get",
 			params: {officeId: officeId}
 		});
 	},
+	getRubbishStation: function () {
+		return request({
+			url: "/dispose/rubbish/getRubbishStation",
+			method: "get",
+		});
+	},
 };

+ 23 - 6
api/garbageClearance/overService.js

@@ -8,6 +8,13 @@ export default {
 			data: inputForm,
 		});
 	},
+	savePhoto: function (inputForm) {
+		return request({
+			url: "/look/over/savePhoto",
+			method: "post",
+			data: inputForm,
+		});
+	},
 
 	getMaxNo: function () {
 		return request({
@@ -36,10 +43,20 @@ export default {
 		});
 	},
 	getNotDisposeList: function (params) {
-	return request({
-		url: "/look/over/getNotDisposeList",
-		method: "get",
-		params: params,
-	});
-},
+		return request({
+			url: "/look/over/getNotDisposeList",
+			method: "get",
+			params: params,
+		});
+	},
+	getPhotoListByAttachmentAndFlag: function (attachmentIds, attachmentFlag) {
+		return request({
+			url: "/look/over/getPhotoListByAttachmentAndFlag",
+			method: "get",
+			params: {
+				attachmentId: attachmentIds,
+				attachmentFlag: attachmentFlag
+			},
+		});
+	}
 };

+ 341 - 114
pages/edt/DisposeRubbishForm.vue

@@ -13,7 +13,7 @@
                 </u-form-item>
 
                 <u-form-item label="所属单位" prop="processingUnitName" :required="true" v-if="disFlag">
-                    <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="处理单位" clearable></u--input>
+                    <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="所属单位" clearable></u--input>
                 </u-form-item>
 
                 <u-form-item label="清运专员" prop="clearUserName">
@@ -24,7 +24,7 @@
                     <u--input v-model="inputForm.clearUserMobile" :disabled="true" placeholder="联系方式" clearable></u--input>
                 </u-form-item>
 
-                <u-form-item label="处理单位" prop="disposeType" :required="true">
+                <u-form-item label="处理方式" prop="disposeType" :required="true">
                     <jp-picker v-model="inputForm.disposeType" rangeKey="label" rangeValue="value" :range="[
                     { label: '转运调剂处理', value: '1' },
                     { label: '自行处理', value: '2' },
@@ -36,18 +36,21 @@
                 </u-form-item>
 
 
-                <u-row :key="index_workOver" v-for="(item,index_workOver) in this.inputForm.workOverNoList">
+                <template>
+                    <div>
+                        <u-form-item
+                                v-for="(item, index_workOver) in inputForm.workOverNoList"
+                                :key="index_workOver"
+                                :label="`巡视工单 ${index_workOver + 1}`"
+                                :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-form-item  :label="`巡视工单 ${index_workOver + 1}`" :required="true" :prop="'workOverNoList[' + index_workOver + '].no'"
-                                 :rules="[
-				     ]">
-                        <u--input v-model="inputForm.workOverNoList[index_workOver].no"  placeholder="请选择巡视工单编号" @focus="showWorkOver(index_workOver)" clearable></u--input>
-                    </u-form-item>
-
-                    <u-form-item label="" >
-                        <u-button type="error" text="删除" @click="removeRow(index_workOver)"></u-button>
-                    </u-form-item>
-                </u-row>
+                            <u-button type="error" style="width: 20%" text="删除" @click="removeRow(index_workOver)"></u-button>
+                        </u-form-item>
+                    </div>
+                </template>
 
                 <u-form-item label="" >
                     <u-button style="width: 100%" type="primary"  @click="addRow()" plain>新增基本信息</u-button>
@@ -55,13 +58,66 @@
 
 
             </u--form>
+
+            <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" v-if="nodeFlag">
+
+                <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="所属单位" prop="processingUnitName" :required="true" v-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-item label="处理方式" prop="disposeType" :required="true" >
+                    <jp-picker v-model="inputForm.disposeType" rangeKey="label" :disabled="true" rangeValue="value" :range="[
+                    { label: '转运调剂处理', value: '1' },
+                    { label: '自行处理', value: '2' },
+                ]" ></jp-picker>
+                </u-form-item>
+
+                <u-form-item label="垃圾站点" prop="rubbishStation">
+                    <u--input v-model="inputForm.rubbishStation" :disabled="true" placeholder="垃圾站点" clearable></u--input>
+                </u-form-item>
+
+
+                <template>
+                    <div>
+                        <u-form-item
+                                v-for="(item, index_workOver) in inputForm.workOverNoList"
+                                :key="index_workOver"
+                                :label="`巡视工单 ${index_workOver + 1}`"
+                                :required="true"
+                                :prop="'workOverNoList[' + index_workOver + '].no'"
+                        >
+                            <u--input
+                                    v-model="inputForm.workOverNoList[index_workOver].no"
+                                    :disabled="true"
+                                    placeholder="请选择巡视工单编号">
+                            </u--input>
+                            <u-button type="primary" style="width: 20%" text="处理" @click="disposeWorkOver(inputForm.workOverNoList[index_workOver].id)"></u-button>
+                        </u-form-item>
+                    </div>
+                </template>
+
+
+            </u--form>
         </view>
 
         <!-- Second Section: 上传图片 -->
         <view class="form-section">
-            <text class="u-demo-block__title">现场照片</text>
+            <text class="u-demo-block__title">清理前照片</text>
             <view class="u-page__upload-item">
                 <u-upload
+                        :disabled="true"
                         :fileList="fileList1"
                         @afterRead="afterRead"
                         @delete="deletePic"
@@ -72,6 +128,38 @@
             </view>
         </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="fileList2"
+                        @afterRead="afterRead"
+                        @delete="deletePic"
+                        name="2"
+                        multiple
+                        :maxCount="10"
+                ></u-upload>
+            </view>
+        </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="fileList3"
+                        @afterRead="afterRead"
+                        @delete="deletePic"
+                        name="3"
+                        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" v-if="!nodeFlag">
@@ -89,7 +177,7 @@
                 </view>-->
             </u--form>
         </view>
-        <WorkOverChoose ref="workOverChoose" @input="selectProjectChange" title="报告项目选择"/>
+        <WorkOverChoose ref="workOverChoose" @input="selectWorkOverChange" title="报告项目选择"/>
     </view>
 </template>
 
@@ -97,8 +185,10 @@
     import disposeRubbishService from '@/api/garbageClearance/disposeRubbishService'
     import overService from '@/api/garbageClearance/overService'
     import WorkOverChoose from './WorkOverChoose'
+    import taskService from "@/api/flowable/taskService"
     import {mapState, mapMutations, mapActions} from 'vuex'
     import * as $auth from "../../common/auth";
+    import { EventBus } from '@/store/eventBus.js';
     export default {
         components: {
             WorkOverChoose,
@@ -112,8 +202,12 @@
                 disFlag: true,  // 启用动态获取处理单位则设置为false
                 processingUnits: [],
                 fileList1: [],
+                fileList2: [],
+                fileList3: [],
                 nodeFlag: false,
                 inputForm: {
+                    programId: '',
+                    programIds: [],
                     no: '',
                     processingUnit: '',
                     processingUnitName: '',
@@ -121,6 +215,7 @@
                     clearUserName: '',
                     clearUserMobile: '',
                     remarks: '',
+                    status: '',
                     workOverNoList: [],
                     disposeType: '',
                     rubbishStation: '',
@@ -138,69 +233,78 @@
         },
         // 页面加载时执行
         async created() {
+            EventBus.$on('refreshPhoto', this.refreshPhoto);
 
-            let data = await disposeRubbishService.getMaxNo();
-            if (data) {
-                let newNo = parseInt(data, 10) + 1;
-                this.inputForm.no = 'XJ-J' + newNo;
-            } else {
-                // 获取当前年份
-                let nowY = new Date().getFullYear();
-                this.inputForm.no = 'XJ-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
-                        });
-                    }
+            if(!this.nodeFlag){
+                let data = await disposeRubbishService.getMaxNo();
+                if (data) {
+                    let newNo = parseInt(data, 10) + 1;
+                    this.inputForm.no = newNo;
+                } else {
+                    // 获取当前年份
+                    let nowY = new Date().getFullYear();
+                    this.inputForm.no = nowY + '0001';
                 }
+                //获取垃圾站点信息
+                let rubbishStation = await disposeRubbishService.getRubbishStation();
+                this.inputForm.rubbishStation = rubbishStation;
+
+                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;
+                    });
             }
 
-            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
+            },
         },
         methods: {
-           init (id) {
+            async init (id) {
                this.nodeFlag = true
                 this.inputForm.id = id
-                /*if (id) {
-                   financeInvoiceService.queryById(id).then((data) => {
-
-                       if (this.status === 'testSee') {
+                if (id) {
+                    await disposeRubbishService.queryById(id).then((data) => {
+                       /*if (this.status === 'testSee') {
                            this.nodeFlag = true
-                           this.testFlag = true
                        } else {
-                           this.commonApi.getTaskNameByProcInsId(data.procInsId).then((data) => {
+                           this.taskService.getTaskNameByProcInsId(data.procInsId).then((data) => {
                                if (this.isNotEmpty(data)) {
                                    if (data === '发起人重新申请' || this.isEmpty(data)) {
                                        this.nodeFlag = false
@@ -214,55 +318,112 @@
                                    console.log('没有')
                                }
                            })
-                       }
+                       }*/
 
 
                         this.inputForm = this.recover(this.inputForm, data)
 
-                        if (this.inputForm.workAttachmentDtoList) {
-                            this.inputForm.workAttachmentDtoList.forEach( (item,index) => {
-                                this.$set(this.showFileList, index, true);
-                            })
+                        if (data.fileList1) {
+                            this.fileList1 = []
+                            data.fileList1.forEach(
+                                (item) => {
+                                    const newItem = {
+                                        attachmentName: item.name,
+                                        fileSize: item.size,
+                                        url: item.temporaryUrl,
+                                        type: item.type,      // 如果不需要,可以不写
+                                    };
+                                    this.fileList1.push(newItem);
+                                }
+                            );
+                        }
+                        if (data.fileList2) {
+                            this.fileList2 = []
+                            data.fileList2.forEach(
+                                (item) => {
+                                    const newItem = {
+                                        attachmentName: item.name,
+                                        fileSize: item.size,
+                                        url: item.temporaryUrl,
+                                        type: item.type,      // 如果不需要,可以不写
+                                    };
+                                    this.fileList2.push(newItem);
+                                }
+                            );
+                        }
+                        if (data.fileList3) {
+                            this.fileList3 = []
+                            data.fileList3.forEach(
+                                (item) => {
+                                    const newItem = {
+                                        attachmentName: item.name,
+                                        fileSize: item.size,
+                                        url: item.temporaryUrl,
+                                        type: item.type,      // 如果不需要,可以不写
+                                    };
+                                    this.fileList3.push(newItem);
+                                }
+                            );
                         }
-
-                       let i = this.inputForm.financeInvoiceBaseDTOList.length
-                       let sun = 0
-                       for (let j = 0; j < i; j++) {
-                           sun = (100*sun + 100* this.inputForm.financeInvoiceBaseDTOList[j].account)/100
-                       }
-
-                       this.inputForm.accountTotal = sun
-                       this.inputForm.billingDate = this.formatDate(new Date())
-                       if ( !this.nodeFlag && this.status !== 'testSee') {
-                           this.inputForm.financeInvoiceDetailDTOList.push({
-                               code: '',
-                               number: '',
-                               account: sun,
-                               rate: '',
-                               amount: '',
-                               tax: '',
-                               allAmount: ''
-                           })
-                       }
-
-                       if (!this.isEmpty(this.inputForm.billingWorkplaceRealId)) {
-                           this.bankList = []
-                           workClientService.queryById(this.inputForm.billingWorkplaceRealId).then((data) => {
-                               if (this.isNotEmpty(data.cwWorkClientBillingDTOList)) {
-                                   data.cwWorkClientBillingDTOList.forEach(i => {
-                                       i.ourBank = i.accountHolder
-                                       let test = {label: i.ourBank, value: i.id, account: i.account}
-                                       this.bankList.push(test)
-                                       this.$set(this.inputForm, 'openBank', i.id);
-                                   })
-                               } else {
-                                   this.bankList = []
-                               }
-                           })
-                       }
                     })
-                }*/
+                }
+            },
+            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);
+                    }
+                }
+                //根据关联的询单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);
+                        }
+                    );
+                }).catch(() => {
+                    reject('数据错误');
+                });
+
+
             },
+
             addRow() {
                 this.inputForm.workOverNoList.push({ recipientAgent: this.userInfo.name,
                     recipientAgentId: this.userInfo.id, recipientOffice: this.userInfo.officeDTO.name });
@@ -274,7 +435,69 @@
 
             },
 
-            removeRow(type,index) {
+            // 显示  项目选择器
+            disposeWorkOver(id) {
+                if(this.inputForm.status === '2'){
+                    uni.navigateTo({
+                        url: '/pages/edt/PatrolWorkOrderForm?id='+id
+                    })
+                }else{
+                    this.toEdit(this.inputForm)
+                }
+
+            },
+            //刷信photo获取对应的id
+            refreshPhoto() {
+                console.log('刷信photo获取对应的id',this.inputForm.id)
+                disposeRubbishService.queryById(this.inputForm.id).then((data) => {
+
+                    if (data.fileList1) {
+                        this.fileList1 = []
+                        data.fileList1.forEach(
+                            (item) => {
+                                const newItem = {
+                                    attachmentName: item.name,
+                                    fileSize: item.size,
+                                    url: item.temporaryUrl,
+                                    type: item.type,      // 如果不需要,可以不写
+                                };
+                                this.fileList1.push(newItem);
+                            }
+                        );
+                    }
+                    if (data.fileList2) {
+                        this.fileList2 = []
+                        data.fileList2.forEach(
+                            (item) => {
+                                const newItem = {
+                                    attachmentName: item.name,
+                                    fileSize: item.size,
+                                    url: item.temporaryUrl,
+                                    type: item.type,      // 如果不需要,可以不写
+                                };
+                                this.fileList2.push(newItem);
+                            }
+                        );
+                    }
+                    if (data.fileList3) {
+                        this.fileList3 = []
+                        data.fileList3.forEach(
+                            (item) => {
+                                const newItem = {
+                                    attachmentName: item.name,
+                                    fileSize: item.size,
+                                    url: item.temporaryUrl,
+                                    type: item.type,      // 如果不需要,可以不写
+                                };
+                                this.fileList3.push(newItem);
+                            }
+                        );
+                    }
+                })
+            },
+
+            removeRow(index) {
+               console.log('index',index)
                 // 点击删除按钮时,从表格中移除指定行
                 this.inputForm.workOverNoList.splice(index, 1);
             },
@@ -342,16 +565,20 @@
 
                     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,      // 如果不需要,可以不写
-                            };
-                        });
+                    if(!this.inputForm.disposeType){
+                        errors.push("请选择处理方式")
+                    }
+                    if(this.inputForm.programId && !this.inputForm.programIds){
+                        this.inputForm.programIds = []
+                        let fruitsArray = this.inputForm.programId.split(',');
+                        this.inputForm.programIds = fruitsArray
+                    }
+                    if(!this.inputForm.programId && this.inputForm.programIds){
+                        const programIdString = this.inputForm.programIds.join(','); // 用逗号分隔
+                        this.inputForm.programId = programIdString
+                    }
+                    if(this.inputForm.programIds.length == 0){
+                        errors.push("请选择巡视工单")
                     }
 
                     if (errors.length > 0) {
@@ -368,9 +595,9 @@
                         // 所有验证通过,执行保存操作
                         this.$refs.inputForm.validate().then(() => {
                             uni.showLoading();
-
-                            overService.save(this.inputForm).then(data => {
-
+                            this.inputForm.status = '2'
+                            disposeRubbishService.save(this.inputForm).then(data => {
+                                callback(data.businessTable, data.businessId,this.inputForm.disposeType);
                                 uni.showToast({title:"提交成功", icon:"success"});
                                 // 返回上一页
                                 uni.navigateBack({

+ 434 - 0
pages/edt/PatrolWorkOrderDisposeForm.vue

@@ -0,0 +1,434 @@
+<template>
+    <view>
+        <cu-custom :backUrl="'/pages/index/index?id=apps'" :isBack="true" bgColor="bg-gradual-blue">
+            <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" v-if="!nodeFlag">
+
+                <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="getUserInfoByOffId"></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
+                        :fileList="fileList1"
+                        @afterRead="afterRead"
+                        @delete="deletePic"
+                        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" v-if="!nodeFlag">
+                <u-form-item label="备注" borderBottom prop="remarks">
+                    <u--textarea placeholder='请填写备注' :maxlength="500" v-model="inputForm.remarks"></u--textarea>
+                </u-form-item>
+
+                <view class="button-container">
+                    <u-button
+                            text="提交"
+                            size="large"
+                            type="primary"
+                            @click="saveForm"
+                    ></u-button>
+                </view>
+            </u--form>
+        </view>
+    </view>
+</template>
+
+<script>
+    import overService from '@/api/garbageClearance/overService'
+    import {mapState, mapMutations, mapActions} from 'vuex'
+    import * as $auth from "../../common/auth";
+    export default {
+        components: {
+        },
+        computed: mapState({
+            userInfo: (state) => state.user.userInfo,
+            avatar: (state) => state.user.avatar
+        }),
+        data () {
+            return {
+                disFlag: true,  // 启用动态获取处理单位则设置为false
+                processingUnits: [],
+                fileList1: [],
+                nodeFlag: false,
+                inputForm: {
+                    no: '',
+                    processingUnit: '',
+                    processingUnitName: '',
+                    clearUserId: '',
+                    clearUserName: '',
+                    clearUserMobile: '',
+                    remarks: '',
+                },
+                rules: {
+                    'processingUnit': [
+                        {
+                            required: true,
+                            message: '处理单位不能为空',
+                            trigger: ['blur', 'change']
+                        }
+                    ],
+                }
+            }
+        },
+        // 页面加载时执行
+        async created() {
+
+            let data = await overService.getMaxNo();
+            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: {
+            status: {
+                type: String,
+                default: ''
+            }
+        },
+        watch: {
+        },
+        methods: {
+           init (id) {
+               this.nodeFlag = true
+                this.inputForm.id = id
+                /*if (id) {
+                   financeInvoiceService.queryById(id).then((data) => {
+
+                       if (this.status === 'testSee') {
+                           this.nodeFlag = true
+                           this.testFlag = true
+                       } else {
+                           this.commonApi.getTaskNameByProcInsId(data.procInsId).then((data) => {
+                               if (this.isNotEmpty(data)) {
+                                   if (data === '发起人重新申请' || this.isEmpty(data)) {
+                                       this.nodeFlag = false
+                                   } else if (data === '发票管理员审核'){
+                                       this.nodeFlag = true
+                                       this.addFlag = true
+                                   }
+                               }else {
+                                   this.testFlag = true
+                                   this.addFlag = true
+                                   console.log('没有')
+                               }
+                           })
+                       }
+
+
+                        this.inputForm = this.recover(this.inputForm, data)
+
+                        if (this.inputForm.workAttachmentDtoList) {
+                            this.inputForm.workAttachmentDtoList.forEach( (item,index) => {
+                                this.$set(this.showFileList, index, true);
+                            })
+                        }
+
+                       let i = this.inputForm.financeInvoiceBaseDTOList.length
+                       let sun = 0
+                       for (let j = 0; j < i; j++) {
+                           sun = (100*sun + 100* this.inputForm.financeInvoiceBaseDTOList[j].account)/100
+                       }
+
+                       this.inputForm.accountTotal = sun
+                       this.inputForm.billingDate = this.formatDate(new Date())
+                       if ( !this.nodeFlag && this.status !== 'testSee') {
+                           this.inputForm.financeInvoiceDetailDTOList.push({
+                               code: '',
+                               number: '',
+                               account: sun,
+                               rate: '',
+                               amount: '',
+                               tax: '',
+                               allAmount: ''
+                           })
+                       }
+
+                       if (!this.isEmpty(this.inputForm.billingWorkplaceRealId)) {
+                           this.bankList = []
+                           workClientService.queryById(this.inputForm.billingWorkplaceRealId).then((data) => {
+                               if (this.isNotEmpty(data.cwWorkClientBillingDTOList)) {
+                                   data.cwWorkClientBillingDTOList.forEach(i => {
+                                       i.ourBank = i.accountHolder
+                                       let test = {label: i.ourBank, value: i.id, account: i.account}
+                                       this.bankList.push(test)
+                                       this.$set(this.inputForm, 'openBank', i.id);
+                                   })
+                               } else {
+                                   this.bankList = []
+                               }
+                           })
+                       }
+                    })
+                }*/
+            },
+            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) {
+
+                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
+                            });
+                        });
+                        reject('Form validation failed');
+                    } else {
+                        // 所有验证通过,执行保存操作
+                        this.$refs.inputForm.validate().then(() => {
+                            uni.showLoading();
+
+                            overService.save(this.inputForm).then(data => {
+
+                                uni.showToast({title:"提交成功", icon:"success"});
+                                // 返回上一页
+                                uni.navigateBack({
+                                    delta: 1
+                                });
+                                resolve('Form saved successfully');
+                            }).catch(error => {
+                                reject('Save operation failed');
+                            });
+                        }).catch(() => {
+                            reject('Form validation failed');
+                        });
+                    }
+                });
+            },
+
+            // 删除图片
+            deletePic(event) {
+                this[`fileList${event.name}`].splice(event.index, 1)
+            },
+            // 新增图片
+            async afterRead(event) {
+                // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+                let lists = [].concat(event.file)
+                let fileListLen = this[`fileList${event.name}`].length
+                lists.map((item) => {
+                    this[`fileList${event.name}`].push({
+                        ...item,
+                        status: 'uploading',
+                        message: '上传中'
+                    })
+                })
+                for (let i = 0; i < lists.length; i++) {
+                    const result = await this.uploadFilePromise(lists[i].url, fileListLen)
+                    let item = this[`fileList${event.name}`][fileListLen]
+                    this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+                        status: 'success',
+                        message: '',
+                        url: result
+                    }))
+                    fileListLen++
+                }
+            },
+            uploadFilePromise(url, index) {
+                console.log($auth.getUserToken())
+                return new Promise((resolve, reject) => {
+                    let a = uni.uploadFile({
+                        url: 'http://localhost:8000/app/file/webUpload/fileUpload', // 仅为示例,非真实的接口地址
+                        filePath: url,
+                        name: 'file',
+                        formData: {
+                            user: this.$store.state.user.userInfo
+                        },
+                        header: {
+                            'token': $auth.getUserToken(),
+                        },
+                        success: (res) => {
+
+                            // this.fileList1[index].url = url
+
+                            setTimeout(() => {
+                                const dataObj = JSON.parse(res.data);
+                                const url = dataObj.url;
+                                resolve(url);
+                            }, 1000);
+                        },
+                        fail: (err) => {
+                            console.error('Upload failed:', err);
+                        }
+                    });
+                })
+            },
+            getUserInfoByOffId(){
+                // 根据组织ID 获取 该村的 村支书
+                overService.getUserInfoByOffId(this.inputForm.processingUnit)
+                    .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;
+    }
+</style>

+ 233 - 106
pages/edt/PatrolWorkOrderForm.vue

@@ -1,6 +1,6 @@
 <template>
     <view>
-        <cu-custom :backUrl="'/pages/index/index?id=apps'" :isBack="true" bgColor="bg-gradual-blue">
+        <cu-custom :backUrl="'/pages/index/index?id=apps'" :isBack="true" bgColor="bg-gradual-blue" v-if="!nodeFlag">
             <block slot="content">建筑垃圾巡视</block>
         </cu-custom>
 
@@ -28,10 +28,33 @@
                     <u--input v-model="inputForm.clearUserMobile" :disabled="true" placeholder="联系方式" clearable></u--input>
                 </u-form-item>
             </u--form>
+
+            <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" v-if="nodeFlag">
+
+                <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="getUserInfoByOffId"></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">
+        <view class="form-section" v-if="!nodeFlag">
             <text class="u-demo-block__title">现场照片</text>
             <view class="u-page__upload-item">
                 <u-upload
@@ -44,6 +67,49 @@
                 ></u-upload>
             </view>
         </view>
+        <!-- Second Section: 上传图片 -->
+        <view class="form-section" v-if="nodeFlag">
+            <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>
+
+        <!-- Second Section: 上传图片 -->
+        <view class="form-section" v-if="nodeFlag">
+            <text class="u-demo-block__title">清理中照片</text>
+            <view class="u-page__upload-item">
+                <u-upload
+                        :fileList="fileList2"
+                        @afterRead="afterRead"
+                        @delete="deletePic"
+                        name="2"
+                        multiple
+                        :maxCount="10"
+                ></u-upload>
+            </view>
+        </view>
+
+        <!-- Second Section: 上传图片 -->
+        <view class="form-section" v-if="nodeFlag">
+            <text class="u-demo-block__title">清理后照片</text>
+            <view class="u-page__upload-item">
+                <u-upload
+                        :fileList="fileList3"
+                        @afterRead="afterRead"
+                        @delete="deletePic"
+                        name="3"
+                        multiple
+                        :maxCount="10"
+                ></u-upload>
+            </view>
+        </view>
 
         <!-- Third Section: 备注 -->
         <view class="form-section">
@@ -61,6 +127,20 @@
                     ></u-button>
                 </view>
             </u--form>
+            <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" v-if="nodeFlag">
+                <u-form-item label="备注" borderBottom prop="remarks">
+                    <u--textarea placeholder='请填写备注' :maxlength="500" :disabled="true" v-model="inputForm.remarks"></u--textarea>
+                </u-form-item>
+
+                <view class="button-container">
+                    <u-button
+                            text="确认"
+                            size="large"
+                            type="primary"
+                            @click="savePhoto"
+                    ></u-button>
+                </view>
+            </u--form>
         </view>
     </view>
 </template>
@@ -69,6 +149,7 @@
     import overService from '@/api/garbageClearance/overService'
     import {mapState, mapMutations, mapActions} from 'vuex'
     import * as $auth from "../../common/auth";
+    import { EventBus } from '@/store/eventBus.js';
     export default {
         components: {
         },
@@ -81,8 +162,11 @@
                 disFlag: true,  // 启用动态获取处理单位则设置为false
                 processingUnits: [],
                 fileList1: [],
+                fileList2: [],
+                fileList3: [],
                 nodeFlag: false,
                 inputForm: {
+                    id: '',
                     no: '',
                     processingUnit: '',
                     processingUnitName: '',
@@ -104,46 +188,48 @@
         },
         // 页面加载时执行
         async created() {
+            if(!this.nodeFlag){
+                let data = await overService.getMaxNo();
+                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';
+                }
 
-            let data = await overService.getMaxNo();
-            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;
+                // 如果要使用动态获取处理单位则设置为true
+                if (false) {
+                    let units = await overService.getProcessingUnit();
+                    let childs = units[0].children;
 
-                if (childs) {
-                    this.processingUnits = [];  // 初始化数组
+                    if (childs) {
+                        this.processingUnits = [];  // 初始化数组
 
-                    for (let i = 0; i < childs.length; i++) {
-                        this.processingUnits.push({
-                            label: childs[i].name,
-                            value: childs[i].id
-                        });
+                        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;
+                    });
             }
 
-            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;
-                });
 
 
         },
@@ -155,79 +241,70 @@
         },
         watch: {
         },
+        onLoad(options) {
+            // 从 options 中获取 id 参数
+            this.id = options.id;
+            // 这里可以调用初始化方法
+            this.init(this.id);
+        },
         methods: {
-           init (id) {
-               this.nodeFlag = true
-                this.inputForm.id = id
-                /*if (id) {
-                   financeInvoiceService.queryById(id).then((data) => {
-
-                       if (this.status === 'testSee') {
-                           this.nodeFlag = true
-                           this.testFlag = true
-                       } else {
-                           this.commonApi.getTaskNameByProcInsId(data.procInsId).then((data) => {
-                               if (this.isNotEmpty(data)) {
-                                   if (data === '发起人重新申请' || this.isEmpty(data)) {
-                                       this.nodeFlag = false
-                                   } else if (data === '发票管理员审核'){
-                                       this.nodeFlag = true
-                                       this.addFlag = true
-                                   }
-                               }else {
-                                   this.testFlag = true
-                                   this.addFlag = true
-                                   console.log('没有')
-                               }
-                           })
-                       }
-
-
-                        this.inputForm = this.recover(this.inputForm, data)
-
-                        if (this.inputForm.workAttachmentDtoList) {
-                            this.inputForm.workAttachmentDtoList.forEach( (item,index) => {
-                                this.$set(this.showFileList, index, true);
-                            })
-                        }
+            async init (id) {
+                if(id){
+                    this.nodeFlag = true
+                    this.inputForm.id = id
+                    if (id) {
+
+                        await overService.queryById(id).then((data) => {
+
+                            this.inputForm = this.recover(this.inputForm, data)
+
+                            if (data.beforeFileList) {
+                                this.fileList1 = []
+                                data.beforeFileList.forEach(
+                                    (item) => {
+                                        const newItem = {
+                                            attachmentName: item.name,
+                                            fileSize: item.size,
+                                            url: item.temporaryUrl,
+                                            type: item.type,      // 如果不需要,可以不写
+                                        };
+                                        this.fileList1.push(newItem);
+                                    }
+                                );
+                            }
+                            if (data.betweenFileList) {
+                                this.fileList2 = []
+                                data.betweenFileList.forEach(
+                                    (item) => {
+                                        const newItem = {
+                                            attachmentName: item.name,
+                                            fileSize: item.size,
+                                            url: item.temporaryUrl,
+                                            type: item.type,      // 如果不需要,可以不写
+                                        };
+                                        this.fileList2.push(newItem);
+                                    }
+                                );
+                            }
+                            if (data.afterFileList) {
+                                this.fileList3 = []
+                                data.afterFileList.forEach(
+                                    (item) => {
+                                        const newItem = {
+                                            attachmentName: item.name,
+                                            fileSize: item.size,
+                                            url: item.temporaryUrl,
+                                            type: item.type,      // 如果不需要,可以不写
+                                        };
+                                        this.fileList3.push(newItem);
+                                    }
+                                );
+                            }
+                        })
+
+                    }
+                }
 
-                       let i = this.inputForm.financeInvoiceBaseDTOList.length
-                       let sun = 0
-                       for (let j = 0; j < i; j++) {
-                           sun = (100*sun + 100* this.inputForm.financeInvoiceBaseDTOList[j].account)/100
-                       }
-
-                       this.inputForm.accountTotal = sun
-                       this.inputForm.billingDate = this.formatDate(new Date())
-                       if ( !this.nodeFlag && this.status !== 'testSee') {
-                           this.inputForm.financeInvoiceDetailDTOList.push({
-                               code: '',
-                               number: '',
-                               account: sun,
-                               rate: '',
-                               amount: '',
-                               tax: '',
-                               allAmount: ''
-                           })
-                       }
-
-                       if (!this.isEmpty(this.inputForm.billingWorkplaceRealId)) {
-                           this.bankList = []
-                           workClientService.queryById(this.inputForm.billingWorkplaceRealId).then((data) => {
-                               if (this.isNotEmpty(data.cwWorkClientBillingDTOList)) {
-                                   data.cwWorkClientBillingDTOList.forEach(i => {
-                                       i.ourBank = i.accountHolder
-                                       let test = {label: i.ourBank, value: i.id, account: i.account}
-                                       this.bankList.push(test)
-                                       this.$set(this.inputForm, 'openBank', i.id);
-                                   })
-                               } else {
-                                   this.bankList = []
-                               }
-                           })
-                       }
-                    })
-                }*/
             },
             formatDate(date) {
                 const dateNew = new Date(date); // 将日期字符串转换为 Date 对象
@@ -300,6 +377,7 @@
                                 fileSize: file.size,
                                 url: file.url,
                                 type: file.type,      // 如果不需要,可以不写
+                                attachmentFlag: 'before',      // 如果不需要,可以不写
                             };
                         });
                     }
@@ -336,6 +414,55 @@
                     }
                 });
             },
+            savePhoto() {
+
+                return new Promise((resolve, reject) => {
+
+                    if (this.fileList2 && this.fileList2.length > 0) {
+                        // 将 fileList1 中的每个文件对象的属性名调整为新的属性名
+                        this.inputForm.fileList2 = this.fileList2.map(file => {
+                            return {
+                                attachmentName: file.name,
+                                fileSize: file.size,
+                                url: file.url,
+                                type: file.type,      // 如果不需要,可以不写
+                                attachmentFlag: 'between',      // 如果不需要,可以不写
+                            };
+                        });
+                    }
+
+                    if (this.fileList3 && this.fileList3.length > 0) {
+                        // 将 fileList1 中的每个文件对象的属性名调整为新的属性名
+                        this.inputForm.fileList3 = this.fileList3.map(file => {
+                            return {
+                                attachmentName: file.name,
+                                fileSize: file.size,
+                                url: file.url,
+                                type: file.type,      // 如果不需要,可以不写
+                                attachmentFlag: 'after',      // 如果不需要,可以不写
+                            };
+                        });
+                    }
+                    //数据保存
+                    this.$refs.inputForm.validate().then(() => {
+                        uni.showLoading();
+
+                        overService.savePhoto(this.inputForm).then(data => {
+                            EventBus.$emit('refreshPhoto');
+                            uni.showToast({title:"提交成功", icon:"success"});
+                            // 返回上一页
+                            uni.navigateBack({
+                                delta: 1
+                            });
+                            resolve('Form saved successfully');
+                        }).catch(error => {
+                            reject('Save operation failed');
+                        });
+                    }).catch(() => {
+                        reject('Form validation failed');
+                    });
+                });
+            },
 
             // 删除图片
             deletePic(event) {

+ 1 - 6
pages/edt/WorkOverChoose.vue

@@ -83,12 +83,7 @@
                     let checkedItems = this.data.filter(item => item.checked).map(item => {
                         return {
                             id: item.id,
-                            projectName: item.projectName,
-                            contractName: item.contractName,
-                            projectNumber: item.projectNumber,
-                            contractId: item.contractId,
-                            reportNo: item.reportNo,
-                            isPreInvoice: item.isPreInvoice,
+                            no: item.no,
                         };
                     });
                     this.$emit('input', checkedItems, this.index);

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

@@ -344,14 +344,16 @@
 			// 启动流程
 			start (vars) {
 			  if (this.formType === '2') { // 外置表单启动
-				this.$refs.form.saveForm((businessTable, businessId) => {
+				this.$refs.form.saveForm((businessTable, businessId,disposeType) => {
+					console.log('start方法disposeType',disposeType)
 				  taskService.start({
 					procDefKey: this.procDefKey,
 					businessTable: businessTable,
 					businessId: businessId,
 					...vars,
 					title: this.title,
-					assignee: this.auditForm.assignee
+					assignee: this.auditForm.assignee,
+				    disposeType: disposeType
 				  }).then((data) => {
 					  uni.showToast({ title: "启动成功", icon: "success" });
 					  uni.navigateTo({
@@ -495,7 +497,7 @@
 			commit (vars) {
 				//定义表单规则
 				 var rule = [
-					{name:"message", checkType : "notnull", checkRule:"",  errorMsg:"审批意见不能为空!"}
+					/*{name:"message", checkType : "notnull", checkRule:"",  errorMsg:"审批意见不能为空!"}*/
 				 ];
 				 //进行表单检查
 				 var formData = this.auditForm;

+ 1 - 1
pages/workbench/task/TaskFormEdit.vue

@@ -471,7 +471,7 @@
 			commit (vars) {
 				//定义表单规则
 				 var rule = [
-					{name:"message", checkType : "notnull", checkRule:"",  errorMsg:"审批意见不能为空!"}
+					/*{name:"message", checkType : "notnull", checkRule:"",  errorMsg:"审批意见不能为空!"}*/
 				 ];
 				 //进行表单检查
 				 var formData = this.auditForm;

+ 9 - 11
pages/workbench/workbench.vue

@@ -94,14 +94,14 @@
 								<view slot="title" class="content" style="line-height: 1.5;">
 									<view class="text-bold text-grey">
 										<view class="ellipsis-description" style="font-size: 16px">
-                      <span style="margin-right: 10px;">
-                        <span class="cuIcon-timefill" style="color: #3c9cff;margin-right: 5px;"></span>
-                        <span>08-20</span>
-                      </span>
-											<span style="margin-right: 10px;">
-                        <span class="cuIcon-locationfill" style="color: #f67e1f;margin-right: 5px;"></span>
-                        <span>前进村</span>
-                      </span>
+										  <span style="margin-right: 10px;">
+											<span class="cuIcon-timefill" style="color: #3c9cff;margin-right: 5px;"></span>
+											<span>{{row.vars.startDate}}</span>
+										  </span>
+										  <span style="margin-right: 10px;">
+											<span class="cuIcon-locationfill" style="color: #f67e1f;margin-right: 5px;"></span>
+											<span>{{row.vars.title}}</span>
+										  </span>
 										</view>
 									</view>
 									<view class="text-grey text-sm" style="font-size: 16px">
@@ -243,7 +243,6 @@
 			};
 		},
 		onLoad() {
-			console.log('onLoad')
 			this.loadmore()
 		},
 		computed:{
@@ -474,8 +473,7 @@
 					procDefId: row.id,
 					status: 'start'
 				}).then((data) => {
-					console.log(data)
-					let processTitle = `${this.username} 在 ${moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [${row.name}]`
+					let processTitle = `${this.userInfo.officeDTO.name} 在 ${moment(new Date()).format('MM-DD')} 发起了 [${row.name}]`
 					let query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
 					uni.navigateTo({
 						url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)

+ 20 - 8
store/index.js

@@ -1,20 +1,26 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import user from './modules/user'
+// store.js
+
+import Vue from 'vue';
+import Vuex from 'vuex';
+import user from './modules/user';
 import notifyService from "@/api/notify/notifyService";
 
-Vue.use(Vuex)
+Vue.use(Vuex);
 
 export default new Vuex.Store({
 	modules: {
 		user
-	 },
+	},
 	state: {
-		messageDataList: []
+		messageDataList: [],
+		triggerShowOpen: false // 新增状态
 	},
 	mutations: {
 		setMessageDataList(state, dataList) {
 			state.messageDataList = dataList;
+		},
+		setTriggerShowOpen(state, value) {
+			state.triggerShowOpen = value;
 		}
 	},
 	actions: {
@@ -22,7 +28,13 @@ export default new Vuex.Store({
 			const data = await notifyService.getUnreadCountByIsSelf({
 				isSelf: true
 			});
-			return data; // 返回数据,如果需要
+			return data;
+		},
+		triggerShowOpen({ commit }) {
+			commit('setTriggerShowOpen', true); // 触发状态改变
+		},
+		resetTriggerShowOpen({ commit }) {
+			commit('setTriggerShowOpen', false); // 重置状态
 		}
 	}
-})
+});