xutongzee 1 år sedan
förälder
incheckning
52929174c1

+ 3 - 3
TODO.md

@@ -40,11 +40,11 @@
 
 # 今日完成
 
-- [ ] 申请人 用车
-- [ ] 申请人 请假
-
 ## 流程
 
 - [ ] 申购申请 module = 1
 - [x] 维修流程 module = 8
 - [ ] 合同呈批 module = 9
+
+- [ ] 申请人 用车
+- [ ] 申请人 请假

+ 7 - 0
public/index.html

@@ -13,5 +13,12 @@
     </noscript>
     <div id="app"></div>
     <!-- built files will be auto injected -->
+
+
+    <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
+    <script>
+      // VConsole 会自动挂载到 `window.VConsole`
+      var vConsole = new window.VConsole();
+    </script>
   </body>
 </html>

+ 7 - 0
src/api/approveinfo.js

@@ -45,3 +45,10 @@ export const putCancel = data => (request({
     url: 'approveinfo/cancel',
     data
 }))
+
+// 申请人列表
+export const getUserList = data => (request({
+    method: 'POST',
+    url: 'approveinfo/get_user_list',
+    data
+}))

+ 9 - 1
src/router/index.js

@@ -32,7 +32,6 @@ const routes = [
   },
 
   {
-    // NOTE: 自己书写外部出差人员
     path: '/applyfor/peers-out-form',
     name: 'PeersOutForm',
     component: () => import(/* webpackChunkName: "index" */ '../views/applyfor/peersOutForm.vue')
@@ -59,6 +58,15 @@ const routes = [
     component: () => import(/* webpackChunkName: "applyfor" */ '../views/applyfor/goods-specifications.vue')
   },
 
+  {
+    meta: {
+      title: '申请人列表'
+    },
+    path: '/applyfor/apply-of-user',
+    name: 'ApplyUser',
+    component: () => import(/* webpackChunkName: "applyfor" */ '../views/applyfor/applyOfUser.vue')
+  },
+
   // NOTE:我的审核状态
   {
     path: '/apply-state',

+ 38 - 0
src/views/applyfor/applyOfUser.vue

@@ -0,0 +1,38 @@
+<template>
+  <div class="apply-user-container">
+    apply user
+  </div>
+</template>
+
+
+<script>
+import { getUserList } from '@/api/approveinfo'
+
+
+export default {
+  name: 'ApplyOfUser',
+
+  data: () => ({
+    userList: [],
+  }),
+  created() {
+    this.__user_list__()
+  },
+  methods: {
+    async __user_list__() {
+      try {
+        const res = await getUserList({
+          page: 1,
+          page_num: 9999
+        })
+        if (res.code === 1) {
+          console.log('%c printlog >>>', 'background: blue; color: #fff', res.data);
+
+        }
+      } catch (error) {
+        console.log('__user_list__ error', error);
+      }
+    }
+  }
+}
+</script>

+ 25 - 64
src/views/applyfor/components/IndexType6.vue

@@ -1,64 +1,25 @@
 <template>
     <div class="type6-container">
-        <c-select
-            title="请假类型"
-            :required="true"
-            :list="askForleaveTypeList"
-            pickerValueKey="name"
-            pickerValueId="id"
-            v-model="type"
-        />
+        <c-select-imitate title="申请人" />
 
-        <c-date
-            title="请假开始时间"
-            :required="true"
-            :has-am="true"
-            v-model="start_time"
-        />
+        <c-select title="请假类型" :required="true" :list="askForleaveTypeList" pickerValueKey="name" pickerValueId="id"
+            v-model="type" />
 
-        <c-date
-            title="请假结束时间"
-            :required="true"
-            :has-am="true"
-            v-model="end_time"
-        />
+        <c-date title="请假开始时间" :required="true" :has-am="true" v-model="start_time" />
 
-        <c-input 
-            title="请假时长(时)"
-            input-type="number"
-            v-model="time"
-        />
+        <c-date title="请假结束时间" :required="true" :has-am="true" v-model="end_time" />
 
-        <c-input
-            title="原因"
-            :required="true"
-            input-type="textarea"
-            :maxlength="300"
-            v-model="reason"
-        />
+        <c-input title="请假时长(时)" input-type="number" v-model="time" />
 
-        <c-files
-            ctype="files"
-            v-model="document"
-        />
+        <c-input title="原因" :required="true" input-type="textarea" :maxlength="300" v-model="reason" />
 
-        <c-files
-            ctype="images"
-            v-model="images"
-        />
+        <c-files ctype="files" v-model="document" />
 
-        <c-input 
-            title="是否离“深”"
-            input-type="textarea"
-            placeholder="需写清目的地(到街道)、是否涉疫、出行方式及班次"
-            v-model="remark"
-        />
+        <c-files ctype="images" v-model="images" />
 
-        <c-flow-path
-            :approve="approvePeople"
-            :copy="copyPeople"
-            :isAllowCopy="isCopy"
-        />
+        <c-input title="是否离“深”" input-type="textarea" placeholder="需写清目的地(到街道)、是否涉疫、出行方式及班次" v-model="remark" />
+
+        <c-flow-path :approve="approvePeople" :copy="copyPeople" :isAllowCopy="isCopy" />
     </div>
 </template>
 
@@ -85,7 +46,7 @@ export default {
             "timeList": "timeList"
         })
     },
-    data () {
+    data() {
         return {
             postApi: null,
 
@@ -110,7 +71,7 @@ export default {
         }
     },
 
-    created () {
+    created() {
         // NOTE: 判断是否有请假类型。 无请假类型router.replace到请假类型上
         let type = this.$route.query.asktype
         if (!type) {
@@ -121,7 +82,7 @@ export default {
     },
 
     methods: {
-        init () {
+        init() {
             this.getCommonFlowPathData()
             this.postApi = this.flag === 'approve' ? editApprove : postCreateInfo
         },
@@ -131,14 +92,14 @@ export default {
         },
 
         // 获取编辑数据
-        handleFormatEditData (data) {
+        handleFormatEditData(data) {
             console.log('%c edit data type6 >>>', 'background: blue; color: #fff', data);
         },
 
         /**
          * @description 提交数据默认函数
          */
-         handleSubmitData () {
+        handleSubmitData() {
             let formData = this.__format_data__()
             console.log('format data>>>', formData);
             let bol = this.validate(formData)
@@ -147,7 +108,7 @@ export default {
             this.__post__(formData)
         },
 
-        __format_data__ () {
+        __format_data__() {
             let templateObj = {
                 module: this.module,
                 reason: this.reason,
@@ -174,7 +135,7 @@ export default {
 
             return templateObj
         },
-        validate (data) {
+        validate(data) {
             let mapTxt = {
                 'type': '请假类型',
                 'start_time': '开始时间',
@@ -193,7 +154,7 @@ export default {
                 data
             })
         },
-        async __post__ (data) {
+        async __post__(data) {
             try {
                 const res = await this.postApi(data)
                 if (res.code === 1) {
@@ -209,13 +170,13 @@ export default {
                     })
                     */
                 }
-            } catch(e) {
+            } catch (e) {
                 console.log('it5, __post__', e);
             }
         },
 
         // NOTE: 检查时间并且查询流程数据
-        checkTimeAndGetFlow () {
+        checkTimeAndGetFlow() {
             let start_time = this.start_time
             let end_time = this.end_time
 
@@ -242,14 +203,14 @@ export default {
     },
 
     watch: {
-        type (val, valo) {
+        type(val, valo) {
             if (val && val !== valo) this.getCommonFlowPathData()
         },
 
-        start_time () {
+        start_time() {
             this.checkTimeAndGetFlow()
         },
-        end_time () {
+        end_time() {
             this.checkTimeAndGetFlow()
         }
     }

+ 56 - 44
src/views/applyfor/components/IndexType7.vue

@@ -1,52 +1,27 @@
 <template>
     <div class="type6-container">
 
+
+        <c-select-imitate title="申请人" :value="apply_user_id_txt" @click="handleEditApplyofUser" />
+
         <div class="group-box">
             <div class="group__title">用车信息</div>
-            <c-input
-                title="出发地点"
-                :required="true"
-                v-model="reason"
-             />
-            <c-date
-                title="出发时间"
-                :required="true"
-                v-model="start_time"
-            />
+            <c-input title="出发地点" :required="true" v-model="reason" />
+            <c-date title="出发时间" :required="true" v-model="start_time" />
         </div>
 
 
         <div class="group-box m-t-10">
-            <c-input
-                title="到达地点"
-                :required="true"
-                v-model="reach_address"
-             />
-            <c-date
-                title="返回时间"
-                v-model="end_time"
-            />
-            <c-input
-                title="返回地点"
-                v-model="end_address"
-             />
+            <c-input title="到达地点" :required="true" v-model="reach_address" />
+            <c-date title="返回时间" v-model="end_time" />
+            <c-input title="返回地点" v-model="end_address" />
         </div>
 
-        <c-files
-            ctype="files"
-            v-model="document"
-        />
+        <c-files ctype="files" v-model="document" />
 
-        <c-files
-            ctype="images"
-            v-model="images"
-        />
+        <c-files ctype="images" v-model="images" />
 
-        <c-flow-path
-            :approve="approvePeople"
-            :copy="copyPeople"
-            :isAllowCopy="isCopy"
-        />
+        <c-flow-path :approve="approvePeople" :copy="copyPeople" :isAllowCopy="isCopy" />
 
     </div>
 </template>
@@ -62,17 +37,29 @@ import indexMixin from '../indexMixins'
 import { postCreateInfo } from '@/api/approveinfo'
 import { editApprove } from '@/api/approve'
 
+import { mapState } from 'vuex'
+
+import { dingtalkComplexPicker } from "@/utils/dingtalk"
+
 
 export default {
     name: 'IndexType7',
     mixins: [
         indexMixin
     ],
-    data () {
+    computed: {
+        ...mapState("user", [
+            'token',
+            'userinfo'
+        ])
+    },
+    data() {
         return {
             postApi: null,
 
             // formData start
+            apply_user_id: '',
+            apply_user_id_txt: '',
             id: '',
             module: 7,
             reason: '', // 出发地点
@@ -88,20 +75,29 @@ export default {
         }
     },
 
-    created () {
+    created() {
         this.getCommonFlowPathData()
         this.postApi = this.flag === 'approve' ? editApprove : postCreateInfo
+
+
+        console.log('%c ???? >>>', 'background: blue; color: #fff', this.token);
+
+        if (this.token) {
+            console.log('%c ----- >>>', 'background: blue; color: #fff', this.userinfo);
+            this.apply_user_id_txt = this.userinfo.name
+            this.apply_user_id = this.userinfo.userid
+        }
     },
 
     methods: {
         // 获取编辑数据
-        handleFormatEditData (data) {
+        handleFormatEditData(data) {
             console.log('%c edit data type6 >>>', 'background: blue; color: #fff', data);
         },
         /**
          * @description 提交数据默认函数
          */
-         handleSubmitData () {
+        handleSubmitData() {
             let formData = this.__format_data__()
             console.log('format data>>>', formData);
             let bol = this.validate(formData)
@@ -109,7 +105,7 @@ export default {
             console.log('execute handleSubmitData', formData);
             this.__post__(formData)
         },
-        __format_data__ () {
+        __format_data__() {
             let templateObj = {
                 module: this.module,
                 reason: this.reason,
@@ -134,7 +130,7 @@ export default {
             // images
             return templateObj
         },
-        validate (data) {
+        validate(data) {
             let mapTxt = {
                 'start_time': '出发时间',
                 'end_time': '返回时间',
@@ -151,7 +147,7 @@ export default {
                 data
             })
         },
-        async __post__ (data) {
+        async __post__(data) {
             try {
                 const res = await this.postApi(data)
                 if (res.code === 1) {
@@ -168,10 +164,26 @@ export default {
                     */
 
                 }
-            } catch(e) {
+            } catch (e) {
                 console.log('it5, __post__', e);
             }
         },
+
+        // NOTE: 跳转申请人列表页面 进行选择申请人
+        async handleEditApplyofUser() {
+            try {
+                const result = await dingtalkComplexPicker({})
+                console.log('%c complexPicker >>>', 'background: blue; color: #fff', result);
+            } catch (error) {
+                console.log('---', error);
+            }
+            // 通过钉钉查询
+            // NOET: 通过页面查询
+            // this.$router.push({
+            //     name: 'ApplyUser',
+            //     query: {}
+            // })
+        }
     },
 }
 

+ 3 - 1
src/views/applyfor/js/IndexComponentsMixins.js

@@ -7,6 +7,7 @@ import CFiles from '../components/CFiles.vue';
 import CFlowPath from '../components/CFlowPath.vue';
 import CDate from '../components/CDate.vue';
 import CSwitch from '../components/CSwitch.vue'
+import CSelectImitate from '../components/CSelectImitate.vue'
 
 export default {
     components: {
@@ -15,6 +16,7 @@ export default {
         CFiles,
         CFlowPath,
         CDate,
-        CSwitch
+        CSwitch,
+        CSelectImitate
     }
 }