Переглянути джерело

景聚庭-添加入库修改

huangguoce 1 день тому
батько
коміт
d0adcd83e1

+ 8 - 0
api/flowable/processService.js

@@ -100,4 +100,12 @@ export default {
 			params: { key: key },
 		});
 	},
+
+	getByName: function (name) {
+		return request({
+			url: prefix + "/flowable/process/getByName",
+			method: "get",
+			params: { name: name },
+		});
+	},
 };

+ 8 - 0
api/flowable/taskService.js

@@ -58,6 +58,14 @@ export default {
 		});
 	},
 
+	getTaskDefInfo: function (params) {
+		return request({
+			url: prefix + "/flowable/task/getTaskDefInfo",
+			method: "get",
+			params: params,
+		});
+	},
+
 	delegate: function (taskId, userId) {
 		return request({
 			url: prefix + "/flowable/task/delegate",

+ 12 - 0
pages.json

@@ -266,6 +266,18 @@
 			"style" : {
 				"navigationBarTitleText": "库存列表"
 			}
+		},
+		{
+			"path" : "pages/psiManagement/wareHouse/WareHouseList",
+			"style" : {
+				"navigationBarTitleText": "入库列表"
+			}
+		},
+		{
+			"path" : "pages/psiManagement/wareHouse/WareHouseUpdateForm",
+			"style" : {
+				"navigationBarTitleText": "入库记录"
+			}
 		}
     ],
 	"subPackages": [{

+ 3 - 3
pages/psiManagement/wareHouse/PurchaseSelector.vue

@@ -1,9 +1,9 @@
 <template>
     <view>
-        <u-form-item label="采购编号" prop="purchaseNo" :required="required">
+        <u-form-item label="采购编号" prop="purchaseNo">
             <view class="selector-trigger" @tap.stop="openPicker">
-                <u--input :value="currentValue" placeholder="请选择采购编号"  :disabled="disabled"
-                    @focus="openPicker" @click="openPicker" @tap="openPicker"></u--input>
+                <u--input :value="currentValue" placeholder="请选择采购编号" :disabled="disabled" @focus="openPicker"
+                    @click="openPicker" @tap="openPicker"></u--input>
             </view>
         </u-form-item>
 

+ 5 - 0
pages/psiManagement/wareHouse/WareHouseAddForm.vue

@@ -659,9 +659,14 @@ export default {
         toSubmitData() {
             const data = JSON.parse(JSON.stringify(this.inputForm))
             data.wareHouseDate = this.formatDate(this.inputForm.wareHouseDate)
+            data.tradeTotalPrice = this.normalizeOptionalNumber(data.tradeTotalPrice)
+            data.wareHouseTotalPrice = this.normalizeOptionalNumber(data.wareHouseTotalPrice)
+            data.wareHouseActualPrice = this.normalizeOptionalNumber(data.wareHouseActualPrice)
             data.wareHouse = (this.inputForm.wareHouse || []).map(item => ({
                 ...JSON.parse(JSON.stringify(item)),
                 produceDate: this.formatDate(item.produceDate),
+                priceSum: this.normalizeOptionalNumber(this.computePriceSum(item.tradePrice, item.tradeNumber)),
+                tradeTotalPrice: this.normalizeOptionalNumber(item.tradeTotalPrice),
                 actualPrice: this.normalizeOptionalNumber(item.actualPrice)
             }))
             return data

+ 721 - 0
pages/psiManagement/wareHouse/WareHouseList.vue

@@ -0,0 +1,721 @@
+<template>
+    <view class="page-wrap">
+ <!--       <cu-custom :backUrl="'/pages/index/index'" :isBack="true" bgColor="bg-gradual-blue">
+            <block slot="content">入库列表</block>
+        </cu-custom> -->
+
+        <view class="search-panel">
+            <u-search :show-action="false" v-model="searchForm.wareHouseNumber" placeholder="搜索入库编号"
+                @search="refreshList" @clear="refreshList"></u-search>
+            <view class="filter-grid">
+                <view class="filter-field">
+                    <text class="filter-label">入库名称</text>
+                    <u--input v-model="searchForm.wareHouseName" placeholder="请输入入库名称" clearable></u--input>
+                </view>
+                <view class="filter-field" @tap="openSupplierPicker">
+                    <text class="filter-label">供应商</text>
+                    <text class="filter-value">{{ searchForm.supplierName || '全部' }}</text>
+                </view>
+                <view class="filter-field">
+                    <text class="filter-label">状态</text>
+                    <jp-picker placeholder="全部" v-model="searchForm.status" rangeKey="label" rangeValue="value"
+                        :range="statusOptions"></jp-picker>
+                </view>
+            </view>
+            <view class="action-row">
+                <el-button class="action-button" type="primary" @click="refreshList">查询</el-button>
+                <el-button class="action-button" plain @click="resetSearch">重置</el-button>
+            </view>
+        </view>
+
+        <view class="summary-row">
+            <text>共 {{ tablePage.total }} 条入库记录</text>
+            <text v-if="loading">加载中...</text>
+        </view>
+
+        <view v-if="!loading && dataList.length === 0" class="empty-state">暂无入库数据</view>
+
+        <view v-for="(item, index) in dataList" :key="item.id || index" class="warehouse-card">
+            <view class="card-head">
+                <view class="warehouse-number" @tap="viewDetail(item)">{{ item.wareHouseNumber || '-' }}</view>
+                修改申请状态:
+                <view class="status-badge" :class="statusClass(item.status)">{{ statusLabel(item.status) }}
+                </view>
+            </view>
+            <view class="warehouse-name">{{ item.wareHouseName || '-' }}</view>
+
+            <view class="info-grid">
+                <view class="info-item">
+                    <text class="info-label">入库时间</text>
+                    <text class="info-value">{{ item.wareHouseDate || '-' }}</text>
+                </view>
+                <view class="info-item">
+                    <text class="info-label">经办人</text>
+                    <text class="info-value">{{ item.handleByName || item.handledBy || '-' }}</text>
+                </view>
+                <view class="info-item">
+                    <text class="info-label">经办部门</text>
+                    <text class="info-value">{{ item.handledByOfficeName || '-' }}</text>
+                </view>
+            </view>
+
+            <view class="card-actions">
+                <el-button class="card-button" plain @click="viewDetail(item)">查看</el-button>
+                <el-button v-if="canApplyUpdate(item)" class="card-button" type="primary" plain
+                    @click="pushUpdate(item)">申请修改</el-button>
+                <el-button v-if="canRevoke(item)" class="card-button" type="primary" plain
+                    @click="revokeUpdate(item)">撤回</el-button>
+                <el-button v-if="canCancelUpdate(item)" class="card-button" type="danger" plain
+                    @click="cancelUpdate(item)">取消修改</el-button>
+                <el-button v-if="canAdjust(item)" class="card-button" type="primary" plain
+                    @click="adjustUpdate(item)">驳回调整</el-button>
+                <el-button v-if="canAudit(item)" class="card-button" type="primary" plain
+                    @click="auditUpdate(item)">审核</el-button>
+                <el-button v-if="canDelete(item)" class="card-button" type="danger" plain
+                    @click="deleteRow(item)">删除</el-button>
+                <el-button v-if="canShowFlowDetail(item)" class="card-button" plain @click="flowDetail(item)">
+                    流程详情
+                </el-button>
+            </view>
+        </view>
+
+        <view v-if="dataList.length" class="load-more">
+            <text v-if="loadingMore">加载中...</text>
+            <text v-else-if="dataList.length >= tablePage.total">没有更多了</text>
+            <text v-else @tap="loadMore">加载更多</text>
+        </view>
+
+        <ware-house-supplier-picker ref="supplierPicker" @selected="selectSupplier" @clear="clearSupplier">
+        </ware-house-supplier-picker>
+    </view>
+</template>
+
+<script>
+import { mapState } from 'vuex'
+import WareHouseService from '@/api/psi/WareHouseService'
+import processService from '@/api/flowable/processService'
+import taskService from '@/api/flowable/taskService'
+import userService from '@/api/sys/userService'
+import WareHouseSupplierPicker from '../wareHouseSummary/WareHouseSupplierPicker.vue'
+
+const BUSINESS_TABLE = 'psi_management_warehouse_basics'
+
+export default {
+    name: 'WareHouseList',
+    components: {
+        WareHouseSupplierPicker
+    },
+    computed: mapState({
+        userInfo: (state) => state.user.userInfo
+    }),
+    data() {
+        return {
+            loading: false,
+            loadingMore: false,
+            isAdmin: false,
+            localUserInfo: null,
+            processDefinitionAuditId: '',
+            procDefAuditKey: '',
+            searchForm: this.createSearchForm(),
+            dataList: [],
+            tablePage: {
+                total: 0,
+                currentPage: 1,
+                pageSize: 10,
+                orders: []
+            },
+            statusOptions: [
+                { label: '未发起', value: '0' },
+                { label: '暂存', value: '1' },
+                { label: '审核中', value: '2' },
+                { label: '已撤回', value: '3' },
+                { label: '已驳回', value: '4' },
+                { label: '已完成', value: '5' }
+            ]
+        }
+    },
+    wareHouseService: null,
+    created() {
+        this.wareHouseService = new WareHouseService()
+        this.initPage()
+    },
+    onPullDownRefresh() {
+        this.refreshList().finally(() => {
+            uni.stopPullDownRefresh()
+        })
+    },
+    onReachBottom() {
+        this.loadMore()
+    },
+    methods: {
+        async initPage() {
+            await this.ensureUserInfo()
+            await Promise.all([
+                this.loadProcessDefinition(),
+                this.checkIsAdmin()
+            ])
+            this.refreshList()
+        },
+        createSearchForm() {
+            return {
+                wareHouseName: '',
+                status: '',
+                wareHouseNumber: '',
+                handledBy: '',
+                handledByOffice: '',
+                wareHouseDates: [],
+                procurementType: '',
+                createBy: '',
+                supplierId: '',
+                supplierName: ''
+            }
+        },
+        async loadProcessDefinition() {
+            try {
+                const data = await processService.getByName('进销存-入库修改')
+                this.processDefinitionAuditId = data && data.id
+                this.procDefAuditKey = data && data.key
+            } catch (e) {
+                this.processDefinitionAuditId = ''
+                this.procDefAuditKey = ''
+            }
+        },
+        async checkIsAdmin() {
+            try {
+                this.isAdmin = await userService.is() === true
+            } catch (e) {
+                this.isAdmin = false
+            }
+        },
+        async ensureUserInfo() {
+            if (this.currentUserId()) {
+                return
+            }
+            try {
+                const data = await userService.info()
+                this.localUserInfo = data && data.user
+                if (this.localUserInfo) {
+                    this.$store.commit('SET_USERINFO', this.localUserInfo)
+                }
+            } catch (e) {
+                this.localUserInfo = null
+            }
+        },
+        async refreshList() {
+            this.tablePage.currentPage = 1
+            this.loading = true
+            try {
+                const data = await this.wareHouseService.wareHouseList({
+                    current: this.tablePage.currentPage,
+                    size: this.tablePage.pageSize,
+                    orders: this.tablePage.orders,
+                    ...this.searchForm
+                })
+                this.dataList = (data && data.records) || []
+                this.tablePage.total = (data && data.total) || 0
+            } finally {
+                this.loading = false
+            }
+        },
+        async loadMore() {
+            if (this.loading || this.loadingMore || this.dataList.length >= this.tablePage.total) {
+                return
+            }
+            this.loadingMore = true
+            try {
+                const nextPage = this.tablePage.currentPage + 1
+                const data = await this.wareHouseService.wareHouseList({
+                    current: nextPage,
+                    size: this.tablePage.pageSize,
+                    orders: this.tablePage.orders,
+                    ...this.searchForm
+                })
+                this.dataList = this.dataList.concat((data && data.records) || [])
+                this.tablePage.currentPage = nextPage
+                this.tablePage.total = (data && data.total) || this.tablePage.total
+            } finally {
+                this.loadingMore = false
+            }
+        },
+        resetSearch() {
+            this.searchForm = this.createSearchForm()
+            this.refreshList()
+        },
+        openSupplierPicker() {
+            this.$refs.supplierPicker.open()
+        },
+        selectSupplier(item) {
+            this.searchForm.supplierId = item.id || ''
+            this.searchForm.supplierName = item.name || ''
+            this.refreshList()
+        },
+        clearSupplier() {
+            this.searchForm.supplierId = ''
+            this.searchForm.supplierName = ''
+            this.refreshList()
+        },
+        viewDetail(row) {
+            uni.navigateTo({
+                url: `/pages/psiManagement/wareHouse/WareHouseUpdateForm?id=${row.id}&method=view&readOnly=true`
+            })
+        },
+        async pushUpdate(row) {
+            await this.ensureRowStatus(row, ['0', '3', '4', '5'])
+            const status = this.normalizeStatus(row.status) === '4' ? 'reapplyFlag' : 'startAndClose'
+            await this.openStartTask(row, status)
+        },
+        async adjustUpdate(row) {
+            await this.ensureRowStatus(row, ['4'])
+            await this.openTodoTask(row)
+        },
+        async auditUpdate(row) {
+            await this.ensureRowStatus(row, ['2'])
+            await this.openTodoTask(row)
+        },
+        async openStartTask(row, status) {
+            await this.ensureProcessDefinition()
+            const data = await taskService.getTaskDef({
+                procDefId: this.processDefinitionAuditId,
+                businessId: row.id,
+                businessTable: BUSINESS_TABLE
+            })
+            const title = '发起流程【入库修改】'
+            const processTitle = `${this.currentUserName()} 在 ${this.formatMinute(new Date())} 发起了[入库修改]`
+            const flow = {
+                ...this.pickTaskDef(data),
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                title,
+                formType: data.formType,
+                formUrl: data.formUrl,
+                formTitle: processTitle,
+                businessTable: BUSINESS_TABLE,
+                businessId: row.id,
+                isShow: 'false',
+                status,
+                routePath: '/psiManagement/wareHouse/WareHouseList',
+                wareHouseId: row.id
+            }
+            this.navigateTaskForm(flow)
+        },
+        async openTodoTask(row) {
+            const data = await taskService.getTaskDefInfo({
+                taskId: row.taskId
+            })
+            const flow = {
+                ...this.pickTaskDef(data),
+                isShow: false,
+                formReadOnly: true,
+                formTitle: `${data.taskName || ''}`,
+                cUser: false,
+                title: `审批【${data.taskName || ''}】`,
+                routePath: '/psiManagement/wareHouse/WareHouseList',
+                wareHouseId: row.id,
+                businessId: data.businessId || row.id
+            }
+            this.navigateTaskForm(flow)
+        },
+        navigateTaskForm(flow) {
+            uni.navigateTo({
+                url: `/pages/workbench/task/TaskForm?flow=${encodeURIComponent(JSON.stringify(flow))}`
+            })
+        },
+        async flowDetail(row) {
+            await this.ensureProcessDefinition()
+            const data = await taskService.getTaskDef({
+                procInsId: row.procInsId,
+                procDefId: this.processDefinitionAuditId
+            })
+            const flow = {
+                ...this.pickTaskDef(data),
+                isShow: 'false',
+                readOnly: true,
+                title: '入库修改流程详情',
+                formTitle: '入库修改流程详情',
+                businessId: row.id,
+                status: 'reback',
+                wareHouseId: row.id
+            }
+            uni.navigateTo({
+                url: `/pages/workbench/task/TaskFormDetail?flow=${encodeURIComponent(JSON.stringify(flow))}`
+            })
+        },
+        async revokeUpdate(row) {
+            uni.showModal({
+                title: '提示',
+                content: '确定要撤回该申请吗?',
+                success: async res => {
+                    if (!res.confirm) {
+                        return
+                    }
+                    await this.ensureRowStatus(row, ['2'])
+                    const msg = await processService.revokeProcIns(row.procInsId)
+                    await this.wareHouseService.updateStatusById({
+                        status: '3',
+                        id: row.id
+                    })
+                    uni.showToast({
+                        title: msg || '撤回成功',
+                        icon: 'success'
+                    })
+                    this.refreshList()
+                }
+            })
+        },
+        async cancelUpdate(row) {
+            uni.showModal({
+                title: '提示',
+                content: '确定要取消修改申请吗?',
+                success: async res => {
+                    if (!res.confirm) {
+                        return
+                    }
+                    await this.ensureRowStatus(row, ['3'])
+                    const data = await this.wareHouseService.backSourceData(row.id)
+                    uni.showToast({
+                        title: data && data.result === 'success' ? '取消修改申请成功' : '取消修改申请失败',
+                        icon: data && data.result === 'success' ? 'success' : 'none'
+                    })
+                    this.refreshList()
+                }
+            })
+        },
+        async deleteRow(row) {
+            uni.showModal({
+                title: '提示',
+                content: '确定删除该入库记录吗?',
+                success: async res => {
+                    if (!res.confirm) {
+                        return
+                    }
+                    const msg = await this.wareHouseService.remove(row.id)
+                    uni.showToast({
+                        title: msg || '删除成功',
+                        icon: 'success'
+                    })
+                    this.refreshList()
+                }
+            })
+        },
+        async ensureRowStatus(row, allowedStatuses) {
+            const data = await this.wareHouseService.findById(row.id)
+            if (!allowedStatuses.includes(this.normalizeStatus(data.status))) {
+                uni.showToast({
+                    title: '数据已发生改变或不存在,请刷新数据1',
+                    icon: 'none'
+                })
+                this.refreshList()
+                throw new Error('invalid status')
+            }
+            return data
+        },
+        async ensureProcessDefinition() {
+            if (!this.processDefinitionAuditId) {
+                await this.loadProcessDefinition()
+            }
+            if (!this.processDefinitionAuditId) {
+                uni.showToast({
+                    title: '未找到入库修改流程',
+                    icon: 'none'
+                })
+                throw new Error('missing process definition')
+            }
+        },
+        pickTaskDef(data) {
+            const keys = ['formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title']
+            return keys.reduce((target, key) => {
+                if (data && Object.prototype.hasOwnProperty.call(data, key)) {
+                    target[key] = data[key]
+                }
+                return target
+            }, {})
+        },
+        currentUser() {
+            return this.localUserInfo || this.userInfo || {}
+        },
+        normalizeId(id) {
+            if (id === null || id === undefined) {
+                return ''
+            }
+            return String(id)
+        },
+        normalizeStatus(status) {
+            if (status === null || status === undefined) {
+                return ''
+            }
+            return String(status)
+        },
+        currentUserId() {
+            const user = this.currentUser()
+            return this.normalizeId(user.id || user.userId)
+        },
+        currentUserName() {
+            const user = this.currentUser()
+            return user.name || user.realname || ''
+        },
+        statusLabel(status) {
+            const item = this.statusOptions.find(option => option.value === this.normalizeStatus(status))
+            return item ? item.label : '-'
+        },
+        statusClass(status) {
+            const currentStatus = this.normalizeStatus(status)
+            return {
+                'status-badge--draft': currentStatus === '0' || currentStatus === '1',
+                'status-badge--audit': currentStatus === '2',
+                'status-badge--revoke': currentStatus === '3',
+                'status-badge--reject': currentStatus === '4',
+                'status-badge--done': currentStatus === '5'
+            }
+        },
+        canApplyUpdate(row) {
+            const status = this.normalizeStatus(row.status)
+            return this.isCreatedByMe(row) && ['0', '3', '5'].includes(status)
+        },
+        canRevoke(row) {
+            return this.isCreatedByMe(row) && this.normalizeStatus(row.status) === '2'
+        },
+        canCancelUpdate(row) {
+            return this.isCreatedByMe(row) && this.normalizeStatus(row.status) === '3'
+        },
+        canAdjust(row) {
+            return this.isCreatedByMe(row) && this.normalizeStatus(row.status) === '4'
+        },
+        canAudit(row) {
+            return this.normalizeStatus(row.status) === '2' && this.isAuditUser(row)
+        },
+        canDelete(row) {
+            return this.isAdmin && ['0', '5'].includes(this.normalizeStatus(row.status))
+        },
+        canShowFlowDetail(row) {
+            const status = this.normalizeStatus(row.status)
+            return status && !['0', '1'].includes(status)
+        },
+        isCreatedByMe(row) {
+            const createBy = row.createBy || row.createById || row.userId || row.handledById
+            return this.normalizeId(createBy) === this.currentUserId()
+        },
+        isAuditUser(row) {
+            const userId = this.currentUserId()
+            if (!userId) {
+                return false
+            }
+            const auditUserIds = Array.isArray(row.auditUserIds)
+                ? row.auditUserIds
+                : String(row.auditUserIds || '').split(',')
+            return auditUserIds.some(id => this.normalizeId(id).trim() === userId)
+        },
+        formatMinute(date) {
+            const d = new Date(date)
+            const year = d.getFullYear()
+            const month = `${d.getMonth() + 1}`.padStart(2, '0')
+            const day = `${d.getDate()}`.padStart(2, '0')
+            const hour = `${d.getHours()}`.padStart(2, '0')
+            const minute = `${d.getMinutes()}`.padStart(2, '0')
+            return `${year}-${month}-${day} ${hour}:${minute}`
+        }
+    }
+}
+</script>
+
+<style scoped>
+.page-wrap {
+    min-height: 100vh;
+    padding: 20rpx 24rpx 48rpx;
+    background: #f6f8fb;
+}
+
+.search-panel {
+    padding: 22rpx;
+    background: #fff;
+    border-radius: 18rpx;
+    box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.05);
+}
+
+.filter-grid {
+    display: grid;
+    grid-template-columns: repeat(1, minmax(0, 1fr));
+    gap: 16rpx;
+    margin-top: 18rpx;
+}
+
+.filter-field {
+    min-width: 0;
+    padding: 18rpx 20rpx;
+    background: #f8fafc;
+    border-radius: 14rpx;
+}
+
+.filter-label {
+    display: block;
+    margin-bottom: 8rpx;
+    font-size: 22rpx;
+    color: #64748b;
+}
+
+.filter-value {
+    display: block;
+    font-size: 26rpx;
+    color: #0f172a;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+
+.action-row {
+    display: flex;
+    gap: 16rpx;
+    margin-top: 18rpx;
+}
+
+.action-button {
+    flex: 1;
+}
+
+.action-row /deep/ .el-button {
+    margin: 0;
+}
+
+.action-row /deep/ .el-button+.el-button {
+    margin-left: 0;
+}
+
+.summary-row {
+    display: flex;
+    justify-content: space-between;
+    padding: 22rpx 4rpx 12rpx;
+    font-size: 24rpx;
+    color: #64748b;
+}
+
+.empty-state {
+    padding: 120rpx 0;
+    text-align: center;
+    font-size: 28rpx;
+    color: #94a3b8;
+}
+
+.warehouse-card {
+    margin-bottom: 20rpx;
+    padding: 24rpx;
+    background: #fff;
+    border-radius: 18rpx;
+    box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.05);
+}
+
+.card-head {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    gap: 16rpx;
+}
+
+.warehouse-number {
+    flex: 1;
+    font-size: 30rpx;
+    font-weight: 700;
+    color: #2979ff;
+    word-break: break-all;
+}
+
+.warehouse-name {
+    margin-top: 12rpx;
+    font-size: 30rpx;
+    font-weight: 700;
+    color: #0f172a;
+    word-break: break-all;
+}
+
+.status-badge {
+    padding: 8rpx 16rpx;
+    border-radius: 999rpx;
+    font-size: 22rpx;
+    font-weight: 700;
+    white-space: nowrap;
+}
+
+.status-badge--draft {
+    color: #475569;
+    background: #e2e8f0;
+}
+
+.status-badge--audit {
+    color: #1d4ed8;
+    background: #dbeafe;
+}
+
+.status-badge--revoke {
+    color: #92400e;
+    background: #fef3c7;
+}
+
+.status-badge--reject {
+    color: #b91c1c;
+    background: #fee2e2;
+}
+
+.status-badge--done {
+    color: #166534;
+    background: #dcfce7;
+}
+
+.info-grid {
+    display: grid;
+    grid-template-columns: repeat(1, minmax(0, 1fr));
+    gap: 14rpx;
+    margin-top: 18rpx;
+}
+
+.info-item {
+    padding: 16rpx 18rpx;
+    background: #f8fafc;
+    border-radius: 14rpx;
+}
+
+.info-label {
+    display: block;
+    font-size: 22rpx;
+    color: #64748b;
+}
+
+.info-value {
+    display: block;
+    margin-top: 8rpx;
+    font-size: 26rpx;
+    color: #0f172a;
+    word-break: break-all;
+}
+
+.card-actions {
+    display: grid;
+    grid-template-columns: repeat(2, minmax(0, 1fr));
+    gap: 14rpx;
+    margin-top: 20rpx;
+}
+
+.card-button {
+    width: 100%;
+}
+
+.card-actions /deep/ .el-button {
+    display: inline-flex;
+    align-items: center;
+    justify-content: center;
+    width: 100%;
+    min-height: 64rpx;
+    margin: 0;
+    padding: 0 12rpx;
+    box-sizing: border-box;
+    line-height: 1.2;
+}
+
+.card-actions /deep/ .el-button+.el-button {
+    margin-left: 0;
+}
+
+.load-more {
+    padding: 24rpx 0;
+    text-align: center;
+    font-size: 26rpx;
+    color: #64748b;
+}
+</style>

+ 173 - 112
pages/psiManagement/wareHouse/WareHouseUpdateForm.vue

@@ -19,8 +19,8 @@
                 <u--input v-model="inputForm.handledByOfficeName" disabled></u--input>
             </u-form-item>
             <u-form-item label="入库时间" borderBottom prop="wareHouseDate" :required="true">
-                <el-date-picker v-model="inputForm.wareHouseDate" type="date" placeholder="请选择入库时间" style="width:100%"
-                    placement="bottom-start" clearable :disabled="nodeFlag">
+                <el-date-picker v-model="inputForm.wareHouseDate" type="date" value-format="yyyy-MM-dd"
+                    placeholder="请选择入库时间" style="width:100%" placement="bottom-start" clearable :disabled="nodeFlag">
                 </el-date-picker>
             </u-form-item>
 
@@ -74,14 +74,10 @@
             </view>
 
             <view class="section-wrap">
-                <view class="section-title">入库修改详情</view>
-                <view v-for="(item, index) in inputForm.wareHouse" :key="item.id || index"
-                    class="detail-card warehouse-card" :class="statusClass(item)">
+                <view class="section-title">入库详情</view>
+                <view v-for="(item, index) in inputForm.wareHouse" :key="item.id || index" class="detail-card">
                     <view class="detail-card-head">
                         <view class="detail-card-title">入库明细 {{ index + 1 }}</view>
-                        <view v-if="statusLabel(item)" class="status-badge" :class="statusBadgeClass(item)">
-                            {{ statusLabel(item) }}
-                        </view>
                     </view>
 
                     <u-form-item label="入库人" :prop="'wareHouse[' + index + '].wareHouseMan'" :required="true">
@@ -156,9 +152,6 @@
 
                     <u-form-item label="" v-if="!nodeFlag">
                         <view class="row-action-group">
-                            <el-button style="width: 100%" type="primary" plain @click="markWareHouseModified(index)">
-                                标记修改
-                            </el-button>
                             <el-button style="width: 100%" type="danger" plain @click="removeWareHouseRow(index)">
                                 删除明细
                             </el-button>
@@ -244,6 +237,7 @@ export default {
             listData: [],
             materialList: [],
             currentTypeIndex: -1,
+            originalWareHouseRows: [],
             inputForm: this.createInputForm(),
             rules: {
                 wareHouseName: [
@@ -253,20 +247,6 @@ export default {
                         trigger: ['blur', 'change']
                     }
                 ],
-                wareHouseDate: [
-                    {
-                        required: true,
-                        message: '入库时间不能为空',
-                        trigger: ['change']
-                    }
-                ],
-                purchaseNo: [
-                    {
-                        required: true,
-                        message: '采购编号不能为空',
-                        trigger: ['blur', 'change']
-                    }
-                ],
                 updateCause: [
                     {
                         required: true,
@@ -305,6 +285,16 @@ export default {
             deep: false
         }
     },
+    async onLoad(options = {}) {
+        const id = options.id || options.businessId || ''
+        if (!id) {
+            return
+        }
+        await this.init(id)
+        if (options.readOnly === 'true' || options.method === 'view') {
+            this.nodeFlag = true
+        }
+    },
     methods: {
         createInputForm() {
             return {
@@ -370,6 +360,7 @@ export default {
         },
         resetForm() {
             this.inputForm = this.createInputForm()
+            this.originalWareHouseRows = []
             this.fillUserInfo()
         },
         async init(id) {
@@ -386,6 +377,10 @@ export default {
                     }
                 }
                 this.inputForm = this.normalizeFormData(this.recover(this.createInputForm(), data))
+                if (this.isEmpty(this.inputForm.id)) {
+                    this.inputForm.id = id
+                }
+                this.originalWareHouseRows = this.cloneRows(this.inputForm.wareHouse)
                 this.fillUserInfo()
                 this.nodeFlag = await this.resolveNodeFlag(data)
                 this.calculateDetailTotalPrice()
@@ -412,22 +407,27 @@ export default {
         normalizeFormData(data) {
             const form = data || this.createInputForm()
             if (this.isNotEmpty(form.wareHouseDate)) {
-                form.wareHouseDate = new Date(form.wareHouseDate)
+                form.wareHouseDate = this.formatDate(form.wareHouseDate)
             }
             form.detailInfos = (form.detailInfos || []).map(item => ({
                 ...item,
                 fileInfoLost: item.fileInfoLost || [],
                 priceSum: this.computePriceSum(item.tradePrice, item.tradeNumber)
             }))
-            form.wareHouse = (form.wareHouse || []).map(item => ({
-                ...item,
-                fileInfoLost: item.fileInfoLost || [],
-                upFlag: item.upFlag || '0',
-                produceDate: this.isNotEmpty(item.produceDate) ? new Date(item.produceDate) : '',
-                priceSum: this.computePriceSum(item.tradePrice, item.tradeNumber)
-            }))
+            form.wareHouse = (form.wareHouse || [])
+                .filter(item => item.upFlag !== '1' && item.upFlag !== '2')
+                .map(item => ({
+                    ...item,
+                    fileInfoLost: item.fileInfoLost || [],
+                    upFlag: item.upFlag || '0',
+                    produceDate: this.isNotEmpty(item.produceDate) ? new Date(item.produceDate) : '',
+                    priceSum: this.computePriceSum(item.tradePrice, item.tradeNumber)
+                }))
             return form
         },
+        cloneRows(rows) {
+            return JSON.parse(JSON.stringify(rows || []))
+        },
         buildTree(nodes, parentId = '0') {
             const tree = []
             for (const node of nodes || []) {
@@ -456,6 +456,16 @@ export default {
         isNotEmpty(value) {
             return !this.isEmpty(value)
         },
+        resolveBusinessId() {
+            return this.inputForm.id || this.businessId || ''
+        },
+        ensureBusinessId() {
+            const id = this.resolveBusinessId()
+            if (this.isNotEmpty(id) && this.isEmpty(this.inputForm.id)) {
+                this.inputForm.id = id
+            }
+            return id
+        },
         computePriceSum(price, number) {
             if (this.isEmpty(price) || this.isEmpty(number)) {
                 return ''
@@ -482,6 +492,65 @@ export default {
             this.inputForm.wareHouseTotalPrice = totalPrice ? totalPrice.toFixed(2) : ''
             this.inputForm.wareHouseActualPrice = totalActual ? totalActual.toFixed(2) : ''
         },
+        getOriginalWareHouseRow(row) {
+            const rowId = row && row.id
+            if (this.isEmpty(rowId)) {
+                return null
+            }
+            return (this.originalWareHouseRows || []).find(item => item.id === rowId) || null
+        },
+        isWareHouseRowChanged(row, originalRow) {
+            if (!row || !originalRow) {
+                return false
+            }
+            const fields = [
+                'wareHouseManId',
+                'wareHouseMan',
+                'deptId',
+                'wareHouseManOffice',
+                'wareHouseTypeId',
+                'wareHouseType',
+                'tradeName',
+                'supplierId',
+                'supplierName',
+                'isSupplier',
+                'tradeNumber',
+                'company',
+                'spec',
+                'tradePrice',
+                'actualPrice',
+                'produceDate',
+                'shelfLife',
+                'shelfLifeUnit',
+                'remarks'
+            ]
+            return fields.some(field => {
+                let nextValue = row[field]
+                let oldValue = originalRow[field]
+                if (field === 'produceDate') {
+                    nextValue = this.formatDate(nextValue)
+                    oldValue = this.formatDate(oldValue)
+                }
+                return String(nextValue || '') !== String(oldValue || '')
+            })
+        },
+        markChangedRowsForSubmit() {
+            ;(this.inputForm.wareHouse || []).forEach((row, index) => {
+                if (this.isEmpty(row.id) || this.isNotEmpty(row.sourceId)) {
+                    return
+                }
+                const originalRow = this.getOriginalWareHouseRow(row)
+                if (this.isWareHouseRowChanged(row, originalRow)) {
+                    this.$set(this.inputForm.wareHouse[index], 'upFlag', '1')
+                }
+            })
+        },
+        normalizeWareHouseAmounts() {
+            ;(this.inputForm.wareHouse || []).forEach((row, index) => {
+                this.$set(this.inputForm.wareHouse[index], 'priceSum', this.computePriceSum(row.tradePrice, row.tradeNumber))
+            })
+            this.calculateWareHouseTotals()
+        },
         openUserPullForm(index) {
             if (this.nodeFlag) {
                 return
@@ -696,14 +765,44 @@ export default {
             return `${year}-${month}-${day}`
         },
         toSubmitData() {
+            const businessId = this.ensureBusinessId()
+            this.normalizeWareHouseAmounts()
+            this.markChangedRowsForSubmit()
             const data = JSON.parse(JSON.stringify(this.inputForm))
+            data.id = data.id || businessId
             data.wareHouseDate = this.formatDate(this.inputForm.wareHouseDate)
+            data.tradeTotalPrice = this.normalizeOptionalNumber(data.tradeTotalPrice)
+            data.wareHouseTotalPrice = this.normalizeOptionalNumber(data.wareHouseTotalPrice)
+            data.wareHouseActualPrice = this.normalizeOptionalNumber(data.wareHouseActualPrice)
             data.wareHouse = (this.inputForm.wareHouse || []).map(item => ({
                 ...JSON.parse(JSON.stringify(item)),
-                produceDate: this.formatDate(item.produceDate)
+                produceDate: this.formatDate(item.produceDate),
+                priceSum: this.normalizeOptionalNumber(this.computePriceSum(item.tradePrice, item.tradeNumber)),
+                tradeTotalPrice: this.normalizeOptionalNumber(item.tradeTotalPrice),
+                actualPrice: this.normalizeOptionalNumber(item.actualPrice)
             }))
             return data
         },
+        normalizeOptionalNumber(value) {
+            if (this.isEmpty(value)) {
+                return null
+            }
+            return value
+        },
+        validateBaseForm() {
+            if (this.isEmpty(this.inputForm.wareHouseDate)) {
+                this.$message.error('入库时间不能为空')
+                return false
+            }
+            return true
+        },
+        validateBusinessId() {
+            if (this.isEmpty(this.ensureBusinessId())) {
+                this.$message.error('入库数据ID为空,请返回列表重新进入')
+                return false
+            }
+            return true
+        },
         validateWareHouseRows() {
             if (this.isEmpty(this.inputForm.wareHouse)) {
                 return true
@@ -747,6 +846,12 @@ export default {
         },
         async saveForm(callback) {
             try {
+                if (!this.validateBaseForm()) {
+                    return
+                }
+                if (!this.validateBusinessId()) {
+                    return
+                }
                 await this.$refs.inputForm.validate()
                 if (!this.validateWareHouseRows()) {
                     return
@@ -767,8 +872,9 @@ export default {
         async startForm(callback) {
             this.loading = true
             try {
-                if (this.isNotEmpty(this.inputForm.id)) {
-                    const data = await this.wareHouseService.findById(this.inputForm.id)
+                const id = this.ensureBusinessId()
+                if (this.isNotEmpty(id)) {
+                    const data = await this.wareHouseService.findById(id)
                     if (this.isNotEmpty(data.status) && !['0', '1', '3', '5'].includes(data.status)) {
                         this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                         throw new Error('invalid status')
@@ -780,6 +886,12 @@ export default {
             }
         },
         async startFormTrue(callback) {
+            if (!this.validateBaseForm()) {
+                return
+            }
+            if (!this.validateBusinessId()) {
+                return
+            }
             await this.$refs.inputForm.validate()
             if (!this.validateWareHouseRows()) {
                 return
@@ -798,7 +910,12 @@ export default {
         async reapplyForm(callback) {
             this.loading = true
             try {
-                const data = await this.wareHouseService.findById(this.inputForm.id)
+                const id = this.ensureBusinessId()
+                if (this.isEmpty(id)) {
+                    this.$message.error('入库数据ID为空,请返回列表重新进入')
+                    throw new Error('missing business id')
+                }
+                const data = await this.wareHouseService.findById(id)
                 if (data.status !== '4') {
                     this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                     throw new Error('invalid status')
@@ -811,6 +928,12 @@ export default {
         async agreeForm(callback) {
             this.loading = true
             try {
+                if (!this.validateBaseForm()) {
+                    return
+                }
+                if (!this.validateBusinessId()) {
+                    return
+                }
                 await this.$refs.inputForm.validate()
                 if (!this.validateWareHouseRows()) {
                     return
@@ -831,8 +954,13 @@ export default {
         async updateStatusById(type, callback) {
             this.loading = true
             try {
+                const id = this.ensureBusinessId()
+                if (this.isEmpty(id)) {
+                    this.$message.error('入库数据ID为空,请返回列表重新进入')
+                    throw new Error('missing business id')
+                }
                 if (type === 'reject' || type === 'reback') {
-                    const data = await this.wareHouseService.findById(this.inputForm.id)
+                    const data = await this.wareHouseService.findById(id)
                     if (data.status !== '2') {
                         this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                         throw new Error('invalid status')
@@ -841,57 +969,21 @@ export default {
                     this.inputForm.status = status
                     await this.wareHouseService.updateStatusById({
                         status,
-                        id: this.inputForm.id
+                        id
                     })
                     callback()
                 } else if (type === 'hold') {
-                    const data = await this.wareHouseService.findById(this.inputForm.id)
+                    const data = await this.wareHouseService.findById(id)
                     if (data.status !== '4') {
                         this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                         throw new Error('invalid status')
                     }
-                    await this.wareHouseService.backSourceData(this.inputForm.id)
+                    await this.wareHouseService.backSourceData(id)
                     callback()
                 }
             } finally {
                 this.loading = false
             }
-        },
-        statusLabel(row) {
-            if (row.upFlag === '1') {
-                return '修改前'
-            }
-            if (row.upFlag === '2') {
-                return '已删除'
-            }
-            if (row.upFlag === '0' && this.isNotEmpty(row.sourceId)) {
-                return '修改后'
-            }
-            return ''
-        },
-        statusClass(row) {
-            if (row.upFlag === '1') {
-                return 'warehouse-card--before'
-            }
-            if (row.upFlag === '2') {
-                return 'warehouse-card--deleted'
-            }
-            if (row.upFlag === '0' && this.isNotEmpty(row.sourceId)) {
-                return 'warehouse-card--after'
-            }
-            return ''
-        },
-        statusBadgeClass(row) {
-            if (row.upFlag === '1') {
-                return 'status-badge--before'
-            }
-            if (row.upFlag === '2') {
-                return 'status-badge--deleted'
-            }
-            if (row.upFlag === '0' && this.isNotEmpty(row.sourceId)) {
-                return 'status-badge--after'
-            }
-            return ''
         }
     }
 }
@@ -959,40 +1051,6 @@ export default {
     word-break: break-all;
 }
 
-.warehouse-card--before {
-    background: #f3f4f6;
-}
-
-.warehouse-card--after {
-    background: #f0fdf4;
-}
-
-.warehouse-card--deleted {
-    background: #fef2f2;
-}
-
-.status-badge {
-    padding: 8rpx 16rpx;
-    border-radius: 999rpx;
-    font-size: 22rpx;
-    font-weight: 600;
-}
-
-.status-badge--before {
-    color: #475569;
-    background: #e2e8f0;
-}
-
-.status-badge--after {
-    color: #166534;
-    background: #dcfce7;
-}
-
-.status-badge--deleted {
-    color: #b91c1c;
-    background: #fee2e2;
-}
-
 .row-action-group {
     display: flex;
     gap: 16rpx;
@@ -1007,12 +1065,15 @@ export default {
 
 .shelf-life-input {
     flex: 1;
+    min-width: 0;
 }
 
 .shelf-life-unit {
-    width: 200rpx;
+    flex: 0 0 128rpx;
+    width: 128rpx;
 }
 
+
 @media (max-width: 768px) {
     .detail-grid {
         grid-template-columns: repeat(1, minmax(0, 1fr));

+ 6 - 8
pages/psiManagement/wareHouseSummary/WareHouseSummaryList.vue

@@ -1,12 +1,12 @@
 <template>
     <view class="page-wrap">
-<!--        <cu-custom :backUrl="'/pages/index/index'" :isBack="true" bgColor="bg-gradual-blue">
+        <!--        <cu-custom :backUrl="'/pages/index/index'" :isBack="true" bgColor="bg-gradual-blue">
             <block slot="content">库存列表</block>
         </cu-custom> -->
 
         <view class="search-panel">
-            <u-search :show-action="false" v-model="searchForm.tradeName" placeholder="搜索商品名称"
-                @search="refreshList" @clear="refreshList"></u-search>
+            <u-search :show-action="false" v-model="searchForm.tradeName" placeholder="搜索商品名称" @search="refreshList"
+                @clear="refreshList"></u-search>
             <view class="filter-row">
                 <view class="filter-item" @tap="openSupplierPicker">
                     <text class="filter-label">供应商</text>
@@ -148,10 +148,8 @@ export default {
             return value
         },
         calcBorrowNumber(row) {
-            if (row.notSurplusStock && row.spec) {
-                return this.trimNumber(parseFloat(row.notSurplusStock) / parseFloat(row.spec))
-            }
-            return '0'
+            if (!row.borrowNumber || !row.spec) return 0
+            return parseFloat((row.borrowNumber / row.spec).toFixed(4))
         },
         calcLossNumber(row) {
             if (row.lossNumber && row.spec) {
@@ -163,7 +161,7 @@ export default {
             if (Number.isNaN(value)) {
                 return '0'
             }
-            return Number.isInteger(value) ? String(value) : value.toFixed(2)
+            return Number.isInteger(value) ? String(value) : value.toFixed(4)
         }
     }
 }

+ 12 - 4
pages/workbench/task/TaskForm.vue

@@ -303,7 +303,7 @@ export default {
 					let input = JSON.parse(JSON.stringify(item))
 					this.formData.push(input)
 				})
-				if (this.status === 'start') {
+				if (this.isStartStatus(this.status)) {
 					// 读取启动表单配置
 					let data = await formService.getStartFormData({ processDefinitionId: this.procDefId })
 					this.setData(data, 'start')
@@ -315,8 +315,10 @@ export default {
 			}
 		}
 		// 读取按钮配置
-		if (this.status === 'start') {
-			this.buttons = [{ code: '_flow_start', name: '启动', isHide: '0' }]
+		if (this.isStartStatus(this.status)) {
+			this.buttons = [{ code: '_flow_start', name: this.status === 'startAndClose' ? '提交' : '启动', isHide: '0' }]
+		} else if (this.status === 'reapplyFlag') {
+			this.buttons = [{ code: '_flow_reapply', name: '重新提交', isHide: '0' }]
 		} else if (this.procDefKey && this.taskDefKey) {
 			// 读取按钮
 			taskDefExtensionService.queryByDefIdAndTaskId({
@@ -411,6 +413,9 @@ export default {
 		}
 	},
 	methods: {
+		isStartStatus(status) {
+			return status === 'start' || status === 'startAndClose'
+		},
 		tabSelect(index) {
 			this.tabIndex = index
 		},
@@ -504,7 +509,10 @@ export default {
 		// 启动流程
 		start(vars) {
 			if (this.formType === '2') { // 外置表单启动
-				this.$refs.form.saveForm((businessTable, businessId, inputForm) => {
+				const submitForm = this.status === 'startAndClose' && this.$refs.form.startForm
+					? this.$refs.form.startForm
+					: this.$refs.form.saveForm
+				submitForm.call(this.$refs.form, (businessTable, businessId, inputForm) => {
 					let assignee = this.auditForm.assignee
 					if (inputForm) {
 						if (inputForm.days) {

+ 312 - 296
pages/workbench/workbench.vue

@@ -3,11 +3,12 @@
 		<cu-custom bgColor="bg-blue">
 			<block slot="content"> 工作台</block>
 		</cu-custom>
-		<swiper class="screen-swiper square-dot bg-blue"  :indicator-dots="true" :circular="true"
-		 :autoplay="true" interval="2000" duration="500">
-			<swiper-item v-for="(item,index) in swiperList"  :key="index">
-				<image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
-				<video :src="item.url" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover" v-if="item.type=='video'"></video>
+		<swiper class="screen-swiper square-dot bg-blue" :indicator-dots="true" :circular="true" :autoplay="true"
+			interval="2000" duration="500">
+			<swiper-item v-for="(item, index) in swiperList" :key="index">
+				<image :src="item.url" mode="aspectFill" v-if="item.type == 'image'"></image>
+				<video :src="item.url" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover"
+					v-if="item.type == 'video'"></video>
 			</swiper-item>
 		</swiper>
 		<view class="cu-list grid col-4 no-border fixed">
@@ -20,7 +21,7 @@
 				<text>已办事项</text>
 			</view>
 			<view @tap="toApplyList" class="circle-button-box">
-				<view   class="cuIcon-peoplelist text-blue circle-button font-size-35"></view>
+				<view class="cuIcon-peoplelist text-blue circle-button font-size-35"></view>
 				<text>我发起的</text>
 			</view>
 			<view @tap="toFlowCopyList" class="circle-button-box">
@@ -32,13 +33,14 @@
 			<template v-for="key in processMap.keys()">
 				<view class="cu-bar bg-white solid-bottom margin-top">
 					<view class="action">
-						<text class=" text-orange font-b">{{key}}</text>
+						<text class=" text-orange font-b">{{ key }}</text>
 					</view>
 				</view>
 				<view class="cu-list grid col-4 no-border">
-					<view class="circle-button-box" @click="start(act)" v-for="(act, index) in processMap.get(key)" :key="index">
+					<view class="circle-button-box" @click="start(act)" v-for="(act, index) in processMap.get(key)"
+						:key="index">
 						<view class="cuIcon-calendar bg-blue text-white circle-button font-size-35"></view>
-						<text class="ellipsis-description">{{act.name}}</text>
+						<text class="ellipsis-description">{{ act.name }}</text>
 					</view>
 				</view>
 			</template>
@@ -48,13 +50,14 @@
 			<template v-for="key in processMap.keys()">
 				<view class="cu-bar bg-white solid-bottom margin-top">
 					<view class="action">
-						<text class=" text-orange font-b">{{key}}</text>
+						<text class=" text-orange font-b">{{ key }}</text>
 					</view>
 				</view>
 				<view class="cu-list grid col-4 no-border">
-					<view class="circle-button-box" @click="start(act)" v-for="(act, index) in processMap.get(key)" :key="index">
+					<view class="circle-button-box" @click="start(act)" v-for="(act, index) in processMap.get(key)"
+						:key="index">
 						<view class="cuIcon-calendar bg-blue text-white circle-button font-size-35"></view>
-						<text class="ellipsis-description">{{act.name}}</text>
+						<text class="ellipsis-description">{{ act.name }}</text>
 					</view>
 				</view>
 			</template>
@@ -65,301 +68,314 @@
 </template>
 
 <script>
-	import userService from "@/api/sys/userService"
-	import moment from 'moment'
-	import {mapState, mapMutations, mapActions} from 'vuex'
-	import actCategoryService from "@/api/flowable/actCategoryService"
-	import processService from "@/api/flowable/processService"
-	import taskService from "@/api/flowable/taskService"
-	export default {
-		data() {
-			return {
-				isAdmin: false,
-				cardCur: 0,
-				dataList: [],
-				categoryList: [],
-				processMap: new Map(),
-				swiperList: [{
-					id: 0,
-					type: 'image',
-					url: '/static/swiper/1.svg'
-				}, {
-					id: 1,
-					type: 'image',
-					url: '/static/swiper/2.svg'
-				}, {
-					id: 2,
-					type: 'image',
-					url: '/static/swiper/3.svg'
-				}, {
-					id: 3,
-					type: 'image',
-					url: '/static/swiper/4.svg'
-				}, {
-					id: 4,
-					type: 'image',
-					url: '/static/swiper/5.svg'
-				}, {
-					id: 5,
-					type: 'image',
-					url: '/static/swiper/6.svg'
-				}, {
-					id: 6,
-					type: 'image',
-					url: '/static/swiper/7.svg'
-				}],
-				dotStyle: false,
-				towerStart: 0,
-				direction: ''
-			};
-		},
-		computed: mapState({
-			 username: (state) => state.user.username,
-			 userInfo: (state) => state.user.userInfo,
-		}),
-	    async mounted() {
-			
-			let res = await actCategoryService.treeData()
-			let data = await processService.list({current: 1, size: -1,type: 'ydd'})
-			this.processMap = new Map()
+import userService from "@/api/sys/userService"
+import moment from 'moment'
+import { mapState, mapMutations, mapActions } from 'vuex'
+import actCategoryService from "@/api/flowable/actCategoryService"
+import processService from "@/api/flowable/processService"
+import taskService from "@/api/flowable/taskService"
+export default {
+	data() {
+		return {
+			isAdmin: false,
+			cardCur: 0,
+			dataList: [],
+			categoryList: [],
+			processMap: new Map(),
+			swiperList: [{
+				id: 0,
+				type: 'image',
+				url: '/static/swiper/1.svg'
+			}, {
+				id: 1,
+				type: 'image',
+				url: '/static/swiper/2.svg'
+			}, {
+				id: 2,
+				type: 'image',
+				url: '/static/swiper/3.svg'
+			}, {
+				id: 3,
+				type: 'image',
+				url: '/static/swiper/4.svg'
+			}, {
+				id: 4,
+				type: 'image',
+				url: '/static/swiper/5.svg'
+			}, {
+				id: 5,
+				type: 'image',
+				url: '/static/swiper/6.svg'
+			}, {
+				id: 6,
+				type: 'image',
+				url: '/static/swiper/7.svg'
+			}],
+			dotStyle: false,
+			towerStart: 0,
+			direction: ''
+		};
+	},
+	computed: mapState({
+		username: (state) => state.user.username,
+		userInfo: (state) => state.user.userInfo,
+	}),
+	async mounted() {
 
-			let list = data.records
-			let test = []
-			let leaveTest = []
-			let jjtTest = []
-			let resignation = []
-			let accounting = []
-			console.log('list', list)
-			list.forEach((item)=>{
-				if (item.category === '未设置') {
-					if (item.name === '进销存-领用申请') {
-						jjtTest.push(item)
-						jjtTest.push({
-							name : "入库",
-							notFlowable :true
-						})
-						jjtTest.push({
-							name : "库存",
-							notFlowable :true
-						})
-						// this.processMap.set('物资管理', [item])
-					}
-					if (item.name === '物资管理-领用申请') {
-						test.push(item)
-						// this.processMap.set('物资管理', [item])
-					}
-					if (item.name === '物资管理-采购申请') {
-						// console.log('item', item)
-						// this.processMap.set('物资管理', [item])
-						test.push(item)
-					}
-					if (item.name === '日常办公-请假申请') {
-						// console.log('item', item)
-						// this.processMap.set('物资管理', [item])
-						leaveTest.push(item)
-					}
-					if (item.name === '会议室预约') {
-						// console.log('item', item)
-						// this.processMap.set('物资管理', [item])
-						leaveTest.push(item)
-					}
-					/*if (item.name === '离职申请') {
-						// console.log('item', item)
-						// this.processMap.set('物资管理', [item])
-						resignation.push(item)
-					}
-					if (item.name === '离职交接申请') {
-						// console.log('item', item)
-						// this.processMap.set('物资管理', [item])
-						resignation.push(item)
-					}*/
-					if (item.name === '会计-报销审批') {
-						// console.log('item', item)
-						// this.processMap.set('物资管理', [item])
-						accounting.push(item)
-					}
-					if (item.name === '会计-发票申请') {
-						accounting.push(item)
-					}
-				}
+		let res = await actCategoryService.treeData()
+		let data = await processService.list({ current: 1, size: -1, type: 'ydd' })
+		this.processMap = new Map()
 
-			})
-			if(this.userInfo.tenantDTO.id == "10009"){
-				this.processMap.set('景聚庭', jjtTest)
-			}else{
-				this.processMap.set('物资管理', test)
-				/*this.processMap.set('日常办公', leaveTest)
-				this.processMap.set('人力资源管理', resignation)*/
-				this.processMap.set('会计', accounting)
+		let list = data.records
+		let test = []
+		let leaveTest = []
+		let jjtTest = []
+		let resignation = []
+		let accounting = []
+		console.log('list', list)
+		list.forEach((item) => {
+			if (item.category === '未设置') {
+				if (item.name === '进销存-领用申请') {
+					jjtTest.push(item)
+					jjtTest.push({
+						name: "入库",
+						notFlowable: true
+					})
+					jjtTest.push({
+						name: "库存",
+						notFlowable: true
+					})
+					jjtTest.push({
+						name: "入库记录",
+						notFlowable: true
+					})
+					// this.processMap.set('物资管理', [item])
+				}
+				if (item.name === '物资管理-领用申请') {
+					test.push(item)
+					// this.processMap.set('物资管理', [item])
+				}
+				if (item.name === '物资管理-采购申请') {
+					// console.log('item', item)
+					// this.processMap.set('物资管理', [item])
+					test.push(item)
+				}
+				if (item.name === '日常办公-请假申请') {
+					// console.log('item', item)
+					// this.processMap.set('物资管理', [item])
+					leaveTest.push(item)
+				}
+				if (item.name === '会议室预约') {
+					// console.log('item', item)
+					// this.processMap.set('物资管理', [item])
+					leaveTest.push(item)
+				}
+				/*if (item.name === '离职申请') {
+					// console.log('item', item)
+					// this.processMap.set('物资管理', [item])
+					resignation.push(item)
+				}
+				if (item.name === '离职交接申请') {
+					// console.log('item', item)
+					// this.processMap.set('物资管理', [item])
+					resignation.push(item)
+				}*/
+				if (item.name === '会计-报销审批') {
+					// console.log('item', item)
+					// this.processMap.set('物资管理', [item])
+					accounting.push(item)
+				}
+				if (item.name === '会计-发票申请') {
+					accounting.push(item)
+				}
 			}
-		
 
-			// if (this.isAdmin) {
-			// 	//如果是管理员 查看所有的流程图信息
-			// 	res.forEach((item)=>{
-			// 		this.processMap.set(item.name, [])
-			// 	})
-			// 	let list = data.records
-			// 	list.forEach((item)=>{
-			// 		if(this.processMap.has(item.category)){
-			// 			let list = this.processMap.get(item.category)
-			// 			list.push(item)
-			// 		}else{
-			// 			this.processMap.set(item.category, [item])
-			// 		}
-			// 	})
-			//
-			// 	for(let [key,value] of this.processMap){
-			// 		console.log(key,value);
-			// 	}
-			// } else {
-			// 	//非管理员用户  只能查看物资领用 与 请假流程信息
-			// 	let list = data.records
-			// 	let test = []
-			// 	console.log('list', list)
-			// 	list.forEach((item)=>{
-			// 		if (item.category === '未设置') {
-			// 			if (item.name === '物资管理-领用申请') {
-			// 				test.push(item)
-			// 				// this.processMap.set('物资管理', [item])
-			// 			}
-			// 			if (item.name === '物资管理-采购申请') {
-			// 				// console.log('item', item)
-			// 				// this.processMap.set('物资管理', [item])
-			// 				test.push(item)
-			// 			}
-			// 		}
-			//
-			// 	})
-			// 	this.processMap.set('物资管理', test)
-			// 	console.log('this.processMap', this.processMap)
-			// }
+		})
+		if (this.userInfo.tenantDTO.id == "10009") {
+			this.processMap.set('景聚庭', jjtTest)
+		} else {
+			this.processMap.set('物资管理', test)
+			/*this.processMap.set('日常办公', leaveTest)
+			this.processMap.set('人力资源管理', resignation)*/
+			this.processMap.set('会计', accounting)
+		}
+
+
+		// if (this.isAdmin) {
+		// 	//如果是管理员 查看所有的流程图信息
+		// 	res.forEach((item)=>{
+		// 		this.processMap.set(item.name, [])
+		// 	})
+		// 	let list = data.records
+		// 	list.forEach((item)=>{
+		// 		if(this.processMap.has(item.category)){
+		// 			let list = this.processMap.get(item.category)
+		// 			list.push(item)
+		// 		}else{
+		// 			this.processMap.set(item.category, [item])
+		// 		}
+		// 	})
+		//
+		// 	for(let [key,value] of this.processMap){
+		// 		console.log(key,value);
+		// 	}
+		// } else {
+		// 	//非管理员用户  只能查看物资领用 与 请假流程信息
+		// 	let list = data.records
+		// 	let test = []
+		// 	console.log('list', list)
+		// 	list.forEach((item)=>{
+		// 		if (item.category === '未设置') {
+		// 			if (item.name === '物资管理-领用申请') {
+		// 				test.push(item)
+		// 				// this.processMap.set('物资管理', [item])
+		// 			}
+		// 			if (item.name === '物资管理-采购申请') {
+		// 				// console.log('item', item)
+		// 				// this.processMap.set('物资管理', [item])
+		// 				test.push(item)
+		// 			}
+		// 		}
+		//
+		// 	})
+		// 	this.processMap.set('物资管理', test)
+		// 	console.log('this.processMap', this.processMap)
+		// }
 
-			
-			
+
+
+	},
+	created() {
+		if (!this.username) {
+			this.refreshUserInfo()
+		}
+		this.checkIsAdmin()
+	},
+	methods: {
+		...mapActions(['refreshUserInfo']),
+		toApplyList(mail) {
+			uni.navigateTo({
+				url: '/pages/workbench/task/ApplyList'
+			})
 		},
-		created() {
-			if(!this.username) {
-				this.refreshUserInfo()
-			}
-			this.checkIsAdmin()
+		toTodoList(mail) {
+			uni.navigateTo({
+				url: '/pages/workbench/task/TodoList'
+			})
 		},
-		methods: {
-			 ...mapActions(['refreshUserInfo']),
-			toApplyList (mail) {
-				uni.navigateTo({
-				   url: '/pages/workbench/task/ApplyList'
-				})
-			},
-			toTodoList (mail) {
-				uni.navigateTo({
-				    url: '/pages/workbench/task/TodoList'
-				})
-			},
-			toHistoryList (mail) {
-				uni.navigateTo({
-				    url: '/pages/workbench/task/HistoryList'
-				})
-			},
-			toFlowCopyList (mail) {
-				uni.navigateTo({
-				    url: '/pages/workbench/task/FlowCopyList'
-				})
-			},
-			start (row) {
-				if(row.notFlowable){
-					switch(row.name){
-						case "入库":
-							uni.navigateTo({
-							    url: '/pages/psiManagement/wareHouse/WareHouseAddForm'
-							})
-							break;
-						case "库存":
-							uni.navigateTo({
-							    url: '/pages/psiManagement/wareHouseSummary/WareHouseSummaryList'
-							})
-							break;	
-							
-							
-					}
-				}else{
-					// 读取流程表单
-					taskService.getTaskDef({
-					  procDefId: row.id,
-					  status: 'start'
-					}).then((data) => {
-						console.log('data',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({
-						 url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
-					  })
-					})
+		toHistoryList(mail) {
+			uni.navigateTo({
+				url: '/pages/workbench/task/HistoryList'
+			})
+		},
+		toFlowCopyList(mail) {
+			uni.navigateTo({
+				url: '/pages/workbench/task/FlowCopyList'
+			})
+		},
+		start(row) {
+			if (row.notFlowable) {
+				switch (row.name) {
+					case "入库":
+						uni.navigateTo({
+							url: '/pages/psiManagement/wareHouse/WareHouseAddForm'
+						})
+						break;
+					case "库存":
+						uni.navigateTo({
+							url: '/pages/psiManagement/wareHouseSummary/WareHouseSummaryList'
+						})
+						break;
+					case "入库记录":
+						uni.navigateTo({
+							url: '/pages/psiManagement/wareHouse/WareHouseList'
+						})
+						break;
 				}
-		  },
-			// 查询当前用户是否是管理员用户
-			checkIsAdmin () {
-				userService.is().then((data) => {
-					this.isAdmin = data
+			} else {
+				// 读取流程表单
+				taskService.getTaskDef({
+					procDefId: row.id,
+					status: 'start'
+				}).then((data) => {
+					console.log('data', 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({
+						url: '/pages/workbench/task/TaskForm?flow=' + JSON.stringify(query)
+					})
 				})
-			},
-		}
+			}
+		},
+		// 查询当前用户是否是管理员用户
+		checkIsAdmin() {
+			userService.is().then((data) => {
+				this.isAdmin = data
+			})
+		},
 	}
+}
 </script>
 
 <style>
-  .cu-list.card-menu {
-      overflow: hidden;
-      margin-right: 5px;
-      margin-left: 5px;
-      border-radius: 7px;
-  }
-  .cu-list.card-menu.margin-top-20 {
-      margin-top: -20px;
-  }
-  .cu-list.menu>.cu-item .content>uni-view:first-child {
-      display: -webkit-box;
-      display: -webkit-flex;
-      display: flex;
-      -webkit-box-align: center;
-      /* -webkit-align-items: center; */
-      /* align-items: center; */
-      display: inline-block;
-      margin-right: 5px;
-      width: 1.6em;
-      text-align: center;
-  }
-  .font-size-35{
-	 font-size: 35px!important;
-  }
-  .circle-button{
-	 width: 44px;
-	 height: 44px;
-	 border-radius: 18px;
-	 padding-top: 4px;
-  }
-  .circle-button-box{
-	  width: 25%;
-	  margin-top: 10px;
-	  display: -webkit-box;
-	  display: -webkit-flex;
-	  display: flex;
-	  -webkit-box-orient: vertical;
-	  -webkit-box-direction: normal;
-	  -webkit-flex-direction: column;
-	  flex-direction: column;
-	  -webkit-box-align: center;
-	  -webkit-align-items: center;
-	  align-items: center;
-	  -webkit-box-pack: center;
-	  -webkit-justify-content: center;
-	  justify-content: center;
-	  box-sizing: border-box;
-  }
-  .font-b {
-	  vertical-align: middle;
-	  font-size: 18px;
-	  font-weight: 500;
-	  color: #3a3a3a;
-  }
+.cu-list.card-menu {
+	overflow: hidden;
+	margin-right: 5px;
+	margin-left: 5px;
+	border-radius: 7px;
+}
+
+.cu-list.card-menu.margin-top-20 {
+	margin-top: -20px;
+}
+
+.cu-list.menu>.cu-item .content>uni-view:first-child {
+	display: -webkit-box;
+	display: -webkit-flex;
+	display: flex;
+	-webkit-box-align: center;
+	/* -webkit-align-items: center; */
+	/* align-items: center; */
+	display: inline-block;
+	margin-right: 5px;
+	width: 1.6em;
+	text-align: center;
+}
+
+.font-size-35 {
+	font-size: 35px !important;
+}
+
+.circle-button {
+	width: 44px;
+	height: 44px;
+	border-radius: 18px;
+	padding-top: 4px;
+}
+
+.circle-button-box {
+	width: 25%;
+	margin-top: 10px;
+	display: -webkit-box;
+	display: -webkit-flex;
+	display: flex;
+	-webkit-box-orient: vertical;
+	-webkit-box-direction: normal;
+	-webkit-flex-direction: column;
+	flex-direction: column;
+	-webkit-box-align: center;
+	-webkit-align-items: center;
+	align-items: center;
+	-webkit-box-pack: center;
+	-webkit-justify-content: center;
+	justify-content: center;
+	box-sizing: border-box;
+}
+
+.font-b {
+	vertical-align: middle;
+	font-size: 18px;
+	font-weight: 500;
+	color: #3a3a3a;
+}
 </style>