zhonghuizhen 1 год назад
Родитель
Сommit
e46f97a215

+ 1 - 1
.env

@@ -9,7 +9,7 @@ VUE_APP_CDN = false
 
 # 此项为jenkins打包需要修改的内容如果修改请明确知会,谢谢
 # 是否启用gz压缩
-VUE_APP_GZ = true
+VUE_APP_GZ = false
 
 # element 颜色
 VUE_APP_ELEMENT_COLOR = #409EFF

+ 30 - 7
package-lock.json

@@ -6686,13 +6686,26 @@
       }
     },
     "echarts": {
-      "version": "4.9.0",
-      "resolved": "https://registry.npmjs.org/echarts/-/echarts-4.9.0.tgz",
-      "integrity": "sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==",
+      "version": "5.5.1",
+      "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.5.1.tgz",
+      "integrity": "sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==",
       "requires": {
-        "zrender": "4.3.2"
+        "tslib": "2.3.0",
+        "zrender": "5.6.0"
+      },
+      "dependencies": {
+        "tslib": {
+          "version": "2.3.0",
+          "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
+          "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
+        }
       }
     },
+    "echarts-stat": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmmirror.com/echarts-stat/-/echarts-stat-1.2.0.tgz",
+      "integrity": "sha512-zLd7Kgs+tuTSeaK0VQEMNmnMivEkhvHIk1gpBtLzpRerfcIQ+Bd5XudOMmtwpaTc1WDZbA7d1V//iiBccR46Qg=="
+    },
     "editorconfig": {
       "version": "0.15.3",
       "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz",
@@ -18861,9 +18874,19 @@
       }
     },
     "zrender": {
-      "version": "4.3.2",
-      "resolved": "https://registry.npmjs.org/zrender/-/zrender-4.3.2.tgz",
-      "integrity": "sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g=="
+      "version": "5.6.0",
+      "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.0.tgz",
+      "integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==",
+      "requires": {
+        "tslib": "2.3.0"
+      },
+      "dependencies": {
+        "tslib": {
+          "version": "2.3.0",
+          "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
+          "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
+        }
+      }
     }
   }
 }

+ 1 - 0
package.json

@@ -60,6 +60,7 @@
     "highlight.js": "^10.1.2",
     "hls.js": "^0.14.11",
     "hotkeys-js": "^3.8.1",
+    "html2canvas": "^1.4.1",
     "jquery": "^3.6.0",
     "js-base64": "^3.7.2",
     "js-cookie": "^2.2.1",

+ 24 - 0
src/api/business/schedule.js

@@ -192,3 +192,27 @@ export function removeAdjustment (params) {
         params
     })
 }
+
+/**
+ * 获取单条调班记录
+ * @param {*} params
+ */
+export function getAdjustmentDetail (params) {
+    return request({
+        url: BUSINESS_BASE_URL() + '/employee/adjustmentDetail/get',
+        method: 'get',
+        params
+    })
+}
+
+/**
+ * 审批(保存)单条调班记录
+ * @param {*} params
+ */
+export function saveAdjustmentDetail (params) {
+    return request({
+        url: BUSINESS_BASE_URL() + '/employee/adjustmentDetail/save',
+        method: 'post',
+        params
+    })
+}

+ 1 - 0
src/main.js

@@ -40,6 +40,7 @@ new Vue({
     router,
     store,
     i18n,
+    devtools: true,
     async created () {
         // 加载接口配置
         await this.$store.dispatch('ibps/api/load')

+ 16 - 4
src/views/business/​scheduleManage/adjust.vue

@@ -25,6 +25,7 @@
             v-if="showAdjustEdit"
             :visible.sync="showAdjustEdit"
             :params="params"
+            :readonly="readonly"
             @refresh="loadData"
             @close="() => showAdjustEdit = false"
         />
@@ -69,7 +70,7 @@ export default {
                     itemWidth: 180,
                     forms: [
                         { prop: 'Q^reason_^SL', label: '调班原因' },
-                        { prop: 'Q^status_^SL', label: '状态', fieldType: 'select', options: stateType },
+                        { prop: 'Q^status^S', label: '状态', fieldType: 'select', options: stateType },
                         { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '申请时间', fieldType: 'daterange', itemWidth: 200 }
                     ]
                 },
@@ -84,9 +85,10 @@ export default {
                     { prop: 'overview', label: '概览', minWidth: 200 }
                 ],
                 rowHandle: {
-                    effect: 'display',
+                    effect: 'default',
+                    // effect: 'display',
                     actions: [
-                        { key: 'edit', label: '编辑', type: 'primary', icon: 'ibps-icon-edit' },
+                        { key: 'edit', label: '编辑', type: 'primary', icon: 'ibps-icon-edit', hidden: function (row) { return row.status !== '草稿' } },
                         { key: 'detail', label: '详情', type: 'primary', icon: 'ibps-icon-list-alt' }
                     ]
                 }
@@ -111,8 +113,18 @@ export default {
          * 获取格式化参数
          */
         getSearchFormData () {
+            debugger
+            let paramjson = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            if (this.$store.getters.isSuper) { // 超级管理员不做申请人过滤
+            } else {
+                const { userId } = this.$store.getters || ''
+                if (userId) {
+                    paramjson['Q^create_By_^S'] = userId
+                }
+            }
             return ActionUtils.formatParams(
-                this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+                // this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+                paramjson,
                 this.pagination,
                 this.sorts
             )

+ 272 - 0
src/views/business/​scheduleManage/adjustVerify.vue

@@ -0,0 +1,272 @@
+<template>
+    <div class="main-container">
+        <ibps-crud
+            ref="crud"
+            :display-field="title"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :row-handle="listConfig.rowHandle"
+            :pagination="pagination"
+            :loading="loading"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+            @row-dblclick="handleRowDblclick">
+            <template slot="dateRange" slot-scope="scope">
+                <span>{{ `${scope.row.startDate} 至 ${scope.row.endDate}` }}</span>
+            </template>
+        </ibps-crud>
+        <adjust-edit
+            v-if = "showAdjustEdit"
+            :visible.sync="showAdjustEdit"
+            :params="params"
+            :readonly="readonly"
+            @refresh="loadData"
+            @close="() => showAdjustEdit = false" />
+    </div>
+</template>
+
+<script>
+import { queryAdjustment, removeAdjustment, saveAdjustment, getAdjustmentDetail, saveAdjustmentDetail } from '@/api/business/schedule'
+import { stateType } from '@/views/constants/schedule'
+import ActionUtils from '@/utils/action'
+import FixHeight from '@/mixins/height'
+import { status } from '@/api/platform/job/scheduler';
+
+export default {
+    components: {
+        AdjustEdit: () => import('./components/adjust-edit')
+    },
+    mixins: [FixHeight],
+    data () {
+        const { userList = [] } = this.$store.getters || {}
+        const userOption = userList.map(item => ({ label: item.userName, value: item.userId }))
+        return {
+            userOption,
+            stateType,
+            title: '调班审核记录',
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: true,
+            height: document.clientHeight,
+            listData: [],
+            pagination: {},
+            sorts: {},
+            showAdjustEdit: false,
+            showAgreeBtnList: [],
+            readonly: false,
+            params: {},
+            listConfig: {
+                /*  toolbars: [
+                    { key: 'search', icon: 'ibps-icon-search', label: '查询', type: 'primary', hidden: false },
+                    { key: 'create', icon: 'ibps-icon-plus', label: '申请', type: 'success', hidden: false },
+                    { key: 'remove', icon: 'ibps-icon-close', label: '删除', type: 'danger', hidden: false }
+                ],*/
+                toolbars: [
+                    { key: 'search', icon: 'ibps-icon-search', label: '查询', type: 'primary', hidden: false },
+                    { key: 'massAgree', icon: 'ibps-icon-check', label: '批量同意', type: 'success', hidden: false },
+                    { key: 'massDisagree', icon: 'ibps-icon-close', label: '批量不同意', type: 'danger', hidden: false }
+                ],
+                searchForm: {
+                    labelWidth: 80,
+                    itemWidth: 180,
+                    forms: [
+                        { prop: 'Q^reason_^SL', label: '调班原因' },
+                        { prop: 'Q^status^S', label: '状态', fieldType: 'select', options: stateType.filter(item => item.value !== '草稿') },
+                        { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '申请时间', fieldType: 'daterange', itemWidth: 200 }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'createBy', label: '申请人', tags: userOption, width: 100 },
+                    { prop: 'createTime', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
+                    { prop: 'executor', label: '审批人', tags: userOption, width: 100 },
+                    { prop: 'executeDate', label: '审批时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
+                    { prop: 'reason', label: '调班原因', width: 150 },
+                    { prop: 'status', label: '状态', tags: stateType, width: 100 },
+                    { prop: 'overview', label: '概览', minWidth: 200 }
+                ],
+                rowHandle: {
+                    effect: 'deafult',
+                    /* effect: 'display',
+                    actions: [
+                       { key: 'edit', label: '编辑', type: 'primary', icon: 'ibps-icon-edit' },
+                        { key: 'detail', label: '详情', type: 'primary', icon: 'ibps-icon-list-alt' }
+                    ]*/
+                    actions: [
+                        { key: 'agree', label: '同意', type: 'success', icon: 'ibps-icon-check', hidden: function (row) { return row.status !== '待审批' && row.status !== '待审核' } },
+                        { key: 'disagree', label: '不同意', type: 'danger', icon: 'ibps-icon-close', hidden: function (row) { return row.status !== '待审批' && row.status !== '待审核' } },
+                        { key: 'detail', label: '详情', type: 'primary', icon: 'ibps-icon-list-alt', hidden: function (row) { return false } }
+                    ]
+                }
+            }
+        }
+    },
+    created () {
+        this.loadData()
+    },
+    methods: {
+        // 加载数据
+        loadData () {
+            this.loading = true
+            queryAdjustment(this.getSearchFormData()).then(res => {
+                ActionUtils.handleListData(this, res.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+
+        /**
+         * 获取格式化参数
+         */
+        getSearchFormData () {
+            let paramjson = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            paramjson['Q^status^NE'] = '草稿'
+            return ActionUtils.formatParams(
+                // this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+                paramjson,
+                this.pagination,
+                this.sorts
+            )
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadData()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                /*
+                case 'create':
+                    this.handleEdit(command, {})
+                    break
+                case 'edit':
+                    this.handleEdit(command, data)
+                    break
+                */
+                case 'massAgree':
+                    this.handleMassAgree(command, data)
+                    break
+                case 'massDisagree':
+                    this.handleMassAgree(command, data)
+                    break
+                case 'agree':
+                    this.handleAgree(command, data)
+                    break
+                case 'disagree':
+                    this.handleAgree(command, data)
+                    break
+                case 'detail':
+                    this.handleEdit(command, data)
+                    break
+                case 'remove':
+                    ActionUtils.removeRecord(selection).then((ids) => {
+                        this.handleRemove(ids)
+                    }).catch((e) => { console.error(e) })
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 处理编辑\详情
+         */
+        async handleEdit (key, { id, scheduleId }) {
+            debugger
+            this.params = {
+                id,
+                scheduleId
+            }
+            this.readonly = key === 'detail'
+            this.showAdjustEdit = true
+            console.log('readonly', this.readonly)
+        },
+        /**
+         * 处理单条同意/不同意
+         */
+        async handleAgree (key, data) {
+            console.log(data)
+            data.status = (key === 'agree' ? (data.status === '待审核' ? '待审批' : '已通过') : '已拒绝')
+            saveAdjustment(data).then(() => {
+                ActionUtils.successMessage()
+                this.search()
+            }).catch((e) => { console.error(e) })
+        },
+        /**
+         * 批量处理同意/不同意
+         */
+        async handleMassAgree (key, data) {
+            console.log(key, data)
+            if (data.length < 1) {
+                ActionUtils.warning('请选择数据!')
+                return
+            }
+            const tableName = 't_adjustment'
+            let uparr = []
+            data.forEach((el) => {
+                uparr.push({
+                    where: {
+                        id_: el.id
+                    },
+                    param: {
+                        status: key === 'massAgree' ? (el.status === '待审核' ? '待审批' : '已通过') : '已拒绝'
+                    }
+                })
+            })
+            const updateParams = {
+                tableName,
+                updList: uparr
+            }
+            this.$common.request('update', updateParams).then(() => {
+                ActionUtils.successMessage()
+                this.search()
+            }).catch((e) => { console.error(e) })
+        },
+        /**
+         * 处理删除
+         */
+        handleRemove (ids) {
+            // return this.$message.warning('避免误删测试数据,联系开发删除')
+            removeAdjustment({ ids }).then(() => {
+                ActionUtils.removeSuccessMessage()
+                this.search()
+            }).catch((e) => { console.error(e) })
+        },
+        /**
+         * 行双击事件
+         *
+         */
+        handleRowDblclick (row) {
+            debugger
+            this.handleEdit(row, 'detail')
+        }
+    }
+}
+</script>
+<style lang="scss"></style>

+ 23 - 13
src/views/business/​scheduleManage/components/adjust-edit.vue

@@ -28,7 +28,7 @@
                     :disabled="readonly"
                     filterable
                     clearable
-                    placeholder="请选择排班"
+                    :placeholder=" readonly ? '' : '请选择排班'"
                     @change="handleScheduleChange"
                 >
                     <el-option
@@ -48,7 +48,7 @@
                     show-word-limit
                     :maxlength="1024"
                     :disabled="readonly"
-                    placeholder="请输入调班原因"
+                    :placeholder=" readonly ? '' : '请输入调班原因'"
                 />
             </el-form-item>
             <el-form-item label="调班班次">
@@ -89,7 +89,7 @@
                             <el-date-picker
                                 v-model="scope.row.beforeDate"
                                 type="date"
-                                placeholder="请选择"
+                                :placeholder=" readonly ? '' : '请选择'"
                                 value-format="yyyy-MM-dd"
                                 :picker-options="pickerOptions"
                                 :disabled="readonly"
@@ -110,7 +110,7 @@
                                 :disabled="readonly"
                                 multiple
                                 filterable
-                                placeholder="请选择调班班次"
+                                :placeholder=" readonly ? '' : '请选择调班班次'"
                             >
                                 <el-option
                                     v-for="item in scope.row.beforeShiftList"
@@ -133,7 +133,7 @@
                                 v-model="scope.row.party"
                                 :disabled="readonly"
                                 filterable
-                                placeholder="请选择目标人员"
+                                :placeholder=" readonly ? '' : '请选择目标人员'"
                                 @change="handlePartyChange($event, scope.row, scope.$index)"
                             >
                                 <el-option
@@ -156,7 +156,7 @@
                             <el-date-picker
                                 v-model="scope.row.afterDate"
                                 type="date"
-                                placeholder="请选择"
+                                :placeholder=" readonly ? '' : '请选择'"
                                 value-format="yyyy-MM-dd"
                                 :picker-options="pickerOptions"
                                 :disabled="readonly"
@@ -177,7 +177,7 @@
                                 :disabled="readonly"
                                 multiple
                                 filterable
-                                placeholder="请选择目标班次"
+                                :placeholder=" readonly ? '' : '请选择目标班次'"
                             >
                                 <el-option
                                     v-for="item in scope.row.afterShiftList"
@@ -241,7 +241,8 @@ export default {
             scheduleOptions: [],
             selectionIndex: [],
             toolbars: [
-                { key: 'save', icon: 'ibps-icon-save', label: '保存', type: 'success' },
+                { key: 'save', icon: 'ibps-icon-save', label: '提交', type: 'success', visible: !this.readonly },
+                { key: 'tempSave', icon: 'ibps-icon-save', label: '暂存', type: 'primary', visible: !this.readonly },
                 { key: 'cancel', icon: 'el-icon-close', label: '关闭', type: 'danger' }
             ],
             tableToolbars: [
@@ -418,7 +419,10 @@ export default {
         handleFormAction ({ key }) {
             switch (key) {
                 case 'save':
-                    this.handleSave()
+                    this.handleSave(key)
+                    break
+                case 'tempSave':
+                    this.handleSave(key)
                     break
                 case 'cancel':
                     this.handleCancel()
@@ -445,7 +449,7 @@ export default {
                     break
             }
         },
-        handleSave () {
+        handleSave (key) {
             const getOverview = (data) => {
                 const result = []
                 data.forEach(i => {
@@ -468,6 +472,11 @@ export default {
                 }
                 const { first, second } = this.$store.getters.level || {}
                 const { scheduleId, reason, adjustList } = this.formData || {}
+                let statusVal = '草稿'
+                if (key === 'tempSave') { // 暂存
+                } else { // 提交
+                    statusVal = adjustList.some(i => this.$utils.isNotEmpty(i.party)) ? '待审核' : '待审批'
+                }
                 // return
                 const submitData = {
                     id: this.params.id,
@@ -476,24 +485,25 @@ export default {
                     reason,
                     diDian: second || first,
                     overview: getOverview(adjustList),
-                    status: adjustList.some(i => this.$utils.isNotEmpty(i.party)) ? '待审核' : '待审批',
+                    status: statusVal,
                     adjustmentDetailPoList: adjustList.map(i => ({
                         recordId: i.recordId,
                         beforeDate: i.beforeDate,
                         beforeAdjust: i.beforeAdjust ? i.beforeAdjust.join(',') : '',
                         party: i.party,
-                        status: i.party ? '待审核' : '待审批',
+                        status: statusVal,
                         afterDate: i.afterDate,
                         afterAdjust: i.afterAdjust ? i.afterAdjust.join(',') : ''
                     }))
                 }
+                console.log('this.params.id', this.params.id)
                 this.submitForm(submitData)
             })
         },
         // 提交数据
         submitForm (data) {
             saveAdjustment(data).then(res => {
-                this.$message.success(`${this.params.action === 'edit' ? '保存' : '申请'}成功`)
+                this.$message.success(`${this.params.action === 'edit' ? '提交' : '申请'}成功`)
                 this.closeDialog()
                 this.$emit('refresh')
             })

+ 11 - 1
src/views/constants/schedule.js

@@ -163,10 +163,15 @@ export const cycleOptions = [
 ]
 
 export const stateType = [
+    {
+        label: '草稿',
+        value: '草稿',
+        type: 'info'
+    },
     {
         label: '待审核',
         value: '待审核',
-        type: 'info'
+        type: 'primary'
     },
     {
         label: '待审批',
@@ -183,6 +188,11 @@ export const stateType = [
         value: '已作废',
         type: 'danger'
     },
+    {
+        label: '已拒绝',
+        value: '已拒绝',
+        type: 'danger'
+    },
     {
         label: '已通过',
         value: '已通过',