Ver código fonte

部分代码提交

user5 8 meses atrás
pai
commit
a4126a926a

+ 8 - 0
api/flowable/taskService.js

@@ -128,4 +128,12 @@ export default {
 			data: data,
 		});
 	},
+	getProcessDefIdByRoleName: function (params) {
+  	console.log(params)
+		return request({
+			url: "/flowable/task/getProcessDefIdByRoleName",
+			method: "get",
+			params: params,
+		});
+	},
 };

+ 31 - 0
api/garbageClearance/disposeRubbishService.js

@@ -0,0 +1,31 @@
+import request from "../../common/request"
+
+export default {
+	save: function (inputForm) {
+		return request({
+			url: "/look/over/save",
+			method: "post",
+			data: inputForm,
+		});
+	},
+
+	getMaxNo: function () {
+		return request({
+			url: "/look/over/getMaxNo",
+			method: "get",
+		});
+	},
+	getProcessingUnit: function () {
+		return request({
+			url: "/look/over/getProcessingUnit",
+			method: "get",
+		});
+	},
+	getUserInfoByOffId: function (officeId) {
+		return request({
+			url: "/look/over/getUserInfoByOffId",
+			method: "get",
+			params: {officeId: officeId}
+		});
+	},
+};

+ 7 - 0
api/garbageClearance/overService.js

@@ -28,4 +28,11 @@ export default {
 			params: {officeId: officeId}
 		});
 	},
+	getNotDisposeList: function (params) {
+	return request({
+		url: "/look/over/getNotDisposeList",
+		method: "get",
+		params: params,
+	});
+},
 };

+ 0 - 1
common/request.js

@@ -29,7 +29,6 @@ function error(res){
 	}
 }
 export function request(body){
-	console.log(body)
 	let {url,method,data,header, params, responseType} = body
 	data = data || params || {};
 	header = header || {'Content-Type': 'application/json; charset=utf-8'}

+ 7 - 1
pages.json

@@ -168,7 +168,13 @@
 		{
 			"path" : "pages/edt/PatrolWorkOrderForm",
 			"style" : {
-				"navigationBarTitleText": "建筑垃圾处理"
+				"navigationBarTitleText": "建筑垃圾巡查"
+			}
+		},
+		{
+			"path" : "pages/edt/DisposeRubbishForm",
+			"style" : {
+				"navigationBarTitleText": "建筑垃圾清运处理"
 			}
 		}
 	],

+ 483 - 0
pages/edt/DisposeRubbishForm.vue

@@ -0,0 +1,483 @@
+<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="所属单位" 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" 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>
+
+
+                <u-row :key="index_workOver" v-for="(item,index_workOver) in this.inputForm.workOverNoList">
+
+                    <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-form-item label="" >
+                    <u-button style="width: 100%" type="primary"  @click="addRow()" plain>新增基本信息</u-button>
+                </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>
+        <WorkOverChoose ref="workOverChoose" @input="selectProjectChange" title="报告项目选择"/>
+    </view>
+</template>
+
+<script>
+    import disposeRubbishService from '@/api/garbageClearance/disposeRubbishService'
+    import overService from '@/api/garbageClearance/overService'
+    import WorkOverChoose from './WorkOverChoose'
+    import {mapState, mapMutations, mapActions} from 'vuex'
+    import * as $auth from "../../common/auth";
+    export default {
+        components: {
+            WorkOverChoose,
+        },
+        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: '',
+                    workOverNoList: [],
+                    disposeType: '',
+                    rubbishStation: '',
+                },
+                rules: {
+                    'processingUnit': [
+                        {
+                            required: true,
+                            message: '处理单位不能为空',
+                            trigger: ['blur', 'change']
+                        }
+                    ],
+                }
+            }
+        },
+        // 页面加载时执行
+        async created() {
+
+            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
+                        });
+                    }
+                }
+            }
+
+            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 = []
+                               }
+                           })
+                       }
+                    })
+                }*/
+            },
+            addRow() {
+                this.inputForm.workOverNoList.push({ recipientAgent: this.userInfo.name,
+                    recipientAgentId: this.userInfo.id, recipientOffice: this.userInfo.officeDTO.name });
+            },
+
+            // 显示  项目选择器
+            showWorkOver(index) {
+                this.$refs.workOverChoose.init(index);
+
+            },
+
+            removeRow(type,index) {
+                // 点击删除按钮时,从表格中移除指定行
+                this.inputForm.workOverNoList.splice(index, 1);
+            },
+
+            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,      // 如果不需要,可以不写
+                            };
+                        });
+                    }
+
+                    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>

+ 1 - 1
pages/edt/PatrolWorkOrderForm.vue

@@ -1,7 +1,7 @@
 <template>
     <view>
         <cu-custom :backUrl="'/pages/index/index?id=apps'" :isBack="true" bgColor="bg-gradual-blue">
-            <block slot="content">建筑垃圾处理</block>
+            <block slot="content">建筑垃圾巡视</block>
         </cu-custom>
 
         <!-- First Section: 巡视工单 to 联系方式 -->

+ 186 - 0
pages/edt/WorkOverChoose.vue

@@ -0,0 +1,186 @@
+<template>
+    <view style="width: 100%;">
+        <u-action-sheet :show="show" @close="onClose">
+            <view class="cu-bar bg-white">
+                <view class="action text-blue"  @tap="onClose">取消</view>
+                <view class="action text-green" @tap="selectUsers">确定</view>
+            </view>
+            <view style="max-height: 300px; overflow-y: auto;">
+                <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 v-if="item.checked" style="color: #409eff;">已选择</view>
+                    </view>
+                </view>
+            </view>
+            <view v-if="!allDataLoaded && !loading" style="text-align: center; padding: 10px;">
+                <button class="load-more-button" @tap="loadMore">加载更多</button>
+            </view>
+            <view v-if="loading" style="text-align: center; padding: 10px;">
+                Loading...
+            </view>
+        </u-action-sheet>
+    </view>
+</template>
+
+<script>
+    import overService from '@/api/garbageClearance/overService'
+
+    export default {
+        data() {
+            return {
+                checkType: '1',
+                show: false,
+                labels:'',
+                index:'',
+                type:'',
+                data: [],
+                localMode: '', // 声明一个本地数据属性
+                allDataLoaded: false, // 跟踪是否所有数据都已加载
+                loading: false, // 跟踪加载状态
+                pageSize: 10, // 每页获取的项目数
+                currentPage: 1 // 当前页数
+            };
+        },
+        props: {
+            value: String,
+            placeholder: {
+                type: String,
+                default: '请选择项目'
+            },
+            readonly: {
+                type: Boolean,
+                default: false
+            },
+            disabled: {
+                type: Boolean,
+                default: false
+            },
+        },
+        mounted() {
+            // this.loadData();
+        },
+        methods: {
+            init(index) {
+                this.pageSize = 10
+                this.currentPage = 1
+                this.show = true;
+                this.index = index;
+                this.localMode = 'multiple'
+                this.loadData();
+            },
+            onItemClick(item) {
+                if (this.localMode  === 'single') {
+                    this.data.forEach(node => {
+                        node.checked = node === item;
+                    });
+                } else {
+                    item.checked = !item.checked;
+                }
+            },
+            selectUsers() {
+                if (this.data.some(item => item.checked)) {
+                    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,
+                        };
+                    });
+                    this.$emit('input', checkedItems, this.index);
+                    this.onClose()
+                } else {
+                    uni.showToast({
+                        title: '请至少选择一条数据',
+                        icon: 'none',
+                        duration: 2000
+                    });
+                }
+            },
+            loadData() {
+                this.loading = true; // 开始加载数据,显示loading状态
+                console.log(3213123)
+                overService.getNotDisposeList({ status: 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 }));
+                        } else {
+                            // 如果不是第一页,则追加到原始数据数组后面
+                            this.data = [...this.data, ...newData.map(item => ({ ...item, checked: false }))];
+                        }
+                        if (data.records.length < this.pageSize) {
+                            this.allDataLoaded = true; // 如果返回的数据少于每页数量,则表示所有数据都已加载
+                        }
+                        if (this.value) {
+                            let keys = this.value.split(',');
+                            this.data.forEach(node => {
+                                if (keys.includes(node.id)) {
+                                    node.checked = true;
+                                }
+                            });
+                            this.labels = this.data.filter(node => node.checked).map(node => node.label).join(',');
+                        }
+                    })
+                    .catch(e => {
+                        this.loading = false; // 数据加载失败,隐藏loading状态
+                        throw e;
+                    });
+            },
+            loadMore() {
+                this.currentPage++; // 增加当前页数
+                this.loadData(); // 加载更多数据
+            },
+            onClose() {
+                // 在关闭操作中清除已选择标记
+                this.data.forEach(item => {
+                    item.checked = false;
+                });
+                this.labels = ''; // 清空标签
+                this.show = false;
+                this.data = []; // 清空原始数据
+            },
+            checkTypeChange(value){
+                this.pageSize = 10
+                this.currentPage = 1
+                this.data = []; // 清空原始数据
+                this.loadData(); // 加载更多数据
+            },
+            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)
+            },
+        }
+    };
+</script>
+
+<style scoped>
+    .load-more-button {
+        background-color: #409eff;
+        color: #fff;
+        border: none;
+        padding: 10px 20px;
+        border-radius: 4px;
+        cursor: pointer;
+    }
+</style>

+ 9 - 2
pages/workbench/task/TaskForm.vue

@@ -12,6 +12,7 @@
 			<view class=" bg-white ">
 				
 				<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> -->
 				  <PreviewForm :formData="formData"  v-if="formType !== '2'"  :processDefinitionId="procDefId" :edit="true" ref="form"></PreviewForm>
 			</view>
@@ -23,7 +24,7 @@
 					<u-form-item  v-if="taskId" label="审批意见" borderBottom prop="message">
 						<u--textarea v-model="auditForm.message"  placeholder="请输入审批意见" border="none"></u--textarea>
 					</u-form-item>
-					<u-form-item label="是否抄送" borderBottom prop="isCC">
+					<!--<u-form-item label="是否抄送" borderBottom prop="isCC">
 						<u-switch v-model="isCC" ></u-switch>
 					</u-form-item>
 					<u-form-item label="抄送给"  v-if="isCC">
@@ -34,7 +35,7 @@
 					</u-form-item>
 					<u-form-item label="指定" v-if="isAssign">
 						<user-select v-model="auditForm.assignee"  ></user-select>
-					</u-form-item>
+					</u-form-item>-->
 						<user-select-dialog title="选择转办用户" ref="transferUserSelectDialog" :showRadio="true" :showCheckBox="false" @doSubmit="selectUsersToTransferTask"></user-select-dialog>
 						<user-select-dialog title="选择委派用户" ref="delegateUserSelectDialog" :showRadio="true" :showCheckBox="false" @doSubmit="selectUsersToDelateTask"></user-select-dialog>
 						<user-select-dialog title="选择加签用户" ref="addSignTaskUserSelectDialog"  @doSubmit="selectUsersToAddSignTask"></user-select-dialog>
@@ -94,6 +95,7 @@
 	import PreviewForm from '../form/GenerateFlowableForm'
 	import TaskBackNodes from './components/TaskBackNodes.vue'
 	import TestActivitiLeaveForm from '@/pages/test/activiti/TestActivitiLeaveForm.vue'
+	import DisposeRubbishForm from '@/pages/edt/DisposeRubbishForm.vue'
 	import moment from 'moment'
 	import taskService from "@/api/flowable/taskService"
 	import formService from "@/api/flowable/formService"
@@ -133,6 +135,10 @@
 				  // uniapp 不支持动态组件,所以通过名称匹配决定调用的表单组件
 				  if(this.formUrl.endsWith('TestActivitiLeaveForm')){ 
 					  this.form = TestActivitiLeaveForm
+				  }
+				  // uniapp 不支持动态组件,所以通过名称匹配决定调用的表单组件
+				  if(this.formUrl.endsWith('DisposeRubbishForm')){
+					  this.form = DisposeRubbishForm
 				  }else{
 					  uni.showToast({ title: '没有关联流程表单!', icon: "none" });
 				  }
@@ -188,6 +194,7 @@
 		  userSelect,
 		  userSelectDialog,
 		  TestActivitiLeaveForm,
+		  DisposeRubbishForm,
 		  TaskBackNodes,
 		  PreviewForm
 		},

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

@@ -23,7 +23,7 @@
 					<u-form-item  v-if="taskId" label="审批意见" borderBottom prop="message">
 						<u--textarea v-model="auditForm.message"  placeholder="请输入审批意见" border="none"></u--textarea>
 					</u-form-item>
-					<u-form-item label="是否抄送" borderBottom prop="isCC">
+					<!--<u-form-item label="是否抄送" borderBottom prop="isCC">
 						<u-switch v-model="isCC" ></u-switch>
 					</u-form-item>
 					<u-form-item label="抄送给"  v-if="isCC">
@@ -34,7 +34,7 @@
 					</u-form-item>
 					<u-form-item label="指定" v-if="isAssign">
 						<user-select v-model="auditForm.assignee"  ></user-select>
-					</u-form-item>
+					</u-form-item>-->
 						<user-select-dialog title="选择转办用户" ref="transferUserSelectDialog" :showRadio="true" :showCheckBox="false" @doSubmit="selectUsersToTransferTask"></user-select-dialog>
 						<user-select-dialog title="选择委派用户" ref="delegateUserSelectDialog" :showRadio="true" :showCheckBox="false" @doSubmit="selectUsersToDelateTask"></user-select-dialog>
 						<user-select-dialog title="选择加签用户" ref="addSignTaskUserSelectDialog"  @doSubmit="selectUsersToAddSignTask"></user-select-dialog>

+ 23 - 2
pages/workbench/workbench.vue

@@ -135,7 +135,7 @@
 		<!-- 页脚区域 -->
 		<view class="footer-div">
 			<u-button v-if="userInfo.roleNames == '巡视员' " type="primary" text="巡视工单" @click="openPatrolWorkOrderForm()"></u-button>
-			<u-button v-if="userInfo.roleNames == '村负责人' " type="primary" text="清运工单" @click="openPatrolWorkOrderForm()"></u-button>
+			<u-button v-if="userInfo.roleNames == '村负责人' " type="primary" text="清运工单" @click="start()"></u-button>
 		</view>
 	</view>
 </template>
@@ -194,6 +194,9 @@
 				searchForm: {
 					title: ''
 				},
+				sprocessForm: {
+					filterText: ''
+				},
 				tablePage: {
 					pages: 0,
 					currentPage: 0,
@@ -448,12 +451,30 @@
 					url: '/pages/workbench/task/FlowCopyList'
 				})
 			},
-			start (row) {
+			async start () {
+				var row = null;
+				//根据当前人的权限获取对应的流程信息
+				const roleNames = this.userInfo.roleNames;
+				// 根据从 Vuex 获取的状态来判断样式
+				switch (roleNames) {
+					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({
 					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 query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
 					uni.navigateTo({

BIN
static/logintitle.png