YangJian0701 1 year ago
parent
commit
19dcf9092f

BIN
ERP.rar


+ 1 - 1
README.md

@@ -16,7 +16,7 @@
 
 考勤管理 https://erp.baozhida.cn/api/ams
 
-立项管理 https://erp.baozhida.cn/testapi/project
+立项管理 https://erp.baozhida.cn///console.log/project
 
 #### 测试环境
 

+ 7 - 4
src/api/Reimburse/index.ts

@@ -1,15 +1,18 @@
 import $http from '../index'
 // 列表 === 我的报销列表
-export const Reimburse_UserList = (params: any) => $http.post('/testapi/salary/Reimburse/User/List', params)
+export const Reimburse_UserList = (params: any) => $http.post('/api/salary/Reimburse/User/List', params)
 
 
 
 //报销列表
-export const Reimburse_List = (params: any) => $http.post('/testapi/salary/Reimburse/List', params)
+export const Reimburse_List = (params: any) => $http.post('/api/salary/Reimburse/List', params)
 
 //报销详情
-export const Reimburse_Get = (params: any) => $http.post('/testapi/salary/Reimburse/Get', params)
+export const Reimburse_Get = (params: any) => $http.post('/api/salary/Reimburse/Get', params)
+
+export const Reimburse_Edit = (params: any) => $http.post('/api/salary/Reimburse/Edit_Remit', params)
+
+export const Reimburse_Audit = (params: any) => $http.post('/api/salary/Reimburse/Edit_Audit', params)
 
-export const Reimburse_Edit = (params: any) => $http.post('/testapi/salary/Reimburse/Edit_Remit', params)
 
 

+ 8 - 8
src/api/ReimburseMy/index.ts

@@ -1,27 +1,27 @@
 import $http from '../index'
 // 列表 === 我的报销列表
-export const ReimburseMy_List = (params: any) => $http.post('/testapi/salary/Reimburse/User_List', params)
+export const ReimburseMy_List = (params: any) => $http.post('/api/salary/Reimburse/User_List', params)
 
 
 //删除报销
-export const ReimburseMy_Del = (params: any) => $http.post('/testapi/salary/Reimburse/Del', params)
+export const ReimburseMy_Del = (params: any) => $http.post('/api/salary/Reimburse/Del', params)
 
 //添加报销
-export const ReimburseMy_Add = (params: any) => $http.post('/testapi/salary/Reimburse/Add', params)
+export const ReimburseMy_Add = (params: any) => $http.post('/api/salary/Reimburse/Add', params)
 
 //编辑报销
-export const ReimburseMy_Edit = (params: any) => $http.post('/testapi/salary/Reimburse/Edit', params)
+export const ReimburseMy_Edit = (params: any) => $http.post('/api/salary/Reimburse/Edit', params)
 
 //添加报销
-export const ReimburseMy_Get = (params: any) => $http.post('/testapi/salary/Reimburse/Get', params)
+export const ReimburseMy_Get = (params: any) => $http.post('/api/salary/Reimburse/Get', params)
 
 //费用类型列表
-export const ReimburseMy_FeeType = (params: any) => $http.post('/testapi/salary/Reimburse/FeeType/List', params)
+export const ReimburseMy_FeeType = (params: any) => $http.post('/api/salary/Reimburse/FeeType/List', params)
 
 //费用明细列表
-export const ReimburseMy_FeeDetails = (params: any) => $http.post('/testapi/salary/Reimburse/FeeDetails/List', params)
+export const ReimburseMy_FeeDetails = (params: any) => $http.post('/api/salary/Reimburse/FeeDetails/List', params)
 
 //提交审核
-export const ReimburseMy_Submit = (params: any) => $http.post('/testapi/salary/Reimburse/Submit_Audit', params)
+export const ReimburseMy_Submit = (params: any) => $http.post('/api/salary/Reimburse/Submit_Audit', params)
 
 

+ 1 - 1
src/api/apiMapList.ts

@@ -1 +1 @@
-export const mapList = ["/testapi/salary/Reimburse/Add","/testapi/salary/Reimburse/Edit"]
+export const mapList = ["/api/salary/Reimburse/Add","/api/salary/Reimburse/Edit"]

+ 4 - 0
src/components/TableBase/index.vue

@@ -79,6 +79,7 @@ defineExpose({
           :align="item.align ?? 'center'"
           :reserve-selection="item.type == 'selection'"
           v-if="item.type == 'selection' || item.type == 'index'"
+          
         ></el-table-column>
         <!-- expand 支持 tsx 语法 && 作用域插槽 (tsx > slot) -->
         <el-table-column v-bind="item" :align="item.align ?? 'center'" v-if="item.type === 'expand'" v-slot="scope">
@@ -92,6 +93,9 @@ defineExpose({
           v-if="!item.type && item.prop && item.name !== item.prop"
           v-slot="scope"
         >
+          <div v-if="item.prop=='T_wait_audit'" style="color: red;">
+            {{ scope.row[item.prop]==true?'待审核':'' }}
+          </div>
           <el-tooltip v-if="item.ellipsis" effect="dark" :content="scope.row[item.prop]" placement="bottom">
             {{ scope.row[item.prop] }}
           </el-tooltip>

+ 60 - 43
src/components/upImg/upimg.vue

@@ -3,65 +3,75 @@
     <div class="">
         <div class="upImg">
             <div class="upImg-item" v-if="!imgData">
-                <input class="upImg-item-input" type="file" placeholder="选择图片" @change="changesFun" />
+                <input class="upImg-item-input" type="file" :disabled="props.disabled" placeholder="选择图片" @change="changesFun" />
                 <div class="upImg-item-icon"><el-icon>
                         <Plus />
                     </el-icon></div>
             </div>
-            <div class="upImg-img" v-else @mouseenter="showModel=true" @mouseleave="showModel=false">
+            <div class="upImg-img" v-else @mouseenter="showModel = true" @mouseleave="showModel = false">
                 <img :src="imgData" style="width: 100%;height: 100%;object-fit: cover;">
-                <div class="upImg-img-model" v-show='showModel'>
-                    <div @click="clickDel" style="color: #fff;">删除</div>
+                <div class="upImg-img-model" v-if='showModel'>
+                    <el-icon @click="clickShow" style="color: #fff;cursor: pointer;font-size: 18px;margin-right: 5px;"><View /></el-icon>
+                    <el-icon @click="clickDel" v-if="!props.disabled" style="color: #fff;cursor: pointer;font-size: 16px;"><Delete /></el-icon>
                 </div>
             </div>
         </div>
+        <el-dialog v-model="dialogVisible" style="z-index: 10;" :append-to-body="true">
+            <img w-full :src="imgData" style="width: 100%;height: auto;"/>
+        </el-dialog>
     </div>
 </template>
 
 <script setup lang="ts">
-import { defineEmits ,ref} from 'vue';
+import {ref } from 'vue';
 import { UpFileToken } from '@/api/public/index'
 import { GlobalStore } from '@/stores/index'
 import { resolve } from 'path';
-import qiniu from "qiniu-js";
-import { ElMessage} from 'element-plus'
+import * as qiniu from "qiniu-js";
+import { ElMessage } from 'element-plus'
+
 
 const props = defineProps({
     imgData: {
         type: String,
         default: () => '',
     },
+    disabled:{
+        type: Boolean,
+        default: () => false,
+    }
 });
 
 const uploadData = {
-  token: '',
-  key: ''
+    token: '',
+    key: ''
 }
 const globalStore = GlobalStore()
 const showModel = ref(false)
 const emits = defineEmits()
 const files = ref()
-const changesFun = async (e:any) => {
+const dialogVisible = ref(false)
+const changesFun = async (e: any) => {
     files.value = e.target.files[0]
     await clickToken()//获取token
-    uploadData.key = e.target.files[0].name  || null
+    uploadData.key = e.target.files[0].name || null
     QiniuYun()
-    console.log('选择',e,uploadData)
+    console.log('选择', e, uploadData)
 }
 
 //获取token Api
 const clickToken = async () => {
-    return new Promise((resolve:any)=>{
+    return new Promise((resolve: any) => {
         UpFileToken({ User_tokey: globalStore.GET_User_tokey }).then(res => {
             uploadData.token = res.Data as string
             resolve()
         })
     })
-   
+
 }
 
 //函数
-const QiniuYun = async ()=>{
+const QiniuYun = async () => {
     var config = {
         useCdnDomain: false, //表示是否使用 cdn 加速域名,为布尔值,true 表示使用,默认为 false。
         region: qiniu.region.z2,
@@ -69,44 +79,47 @@ const QiniuYun = async ()=>{
         chunkSize: 1000, //每个分片的大小,单位mb,默认值3
         forceDirect: false //直传还是断点续传方式,true为直传
     };
-    var putExtra = {
+    var putExtra: any = {
         fname: files.value.name, //文件原始文件名
         params: {},
         mimeType: [] || null
     };
-    var observable = qiniu.upload(files.value, {...uploadData});
+    var observable = qiniu.upload(files.value, uploadData.key, uploadData.token, putExtra, config);
     //   设置实例的监听对象
     var observer = {
-    next(res:any) {
-       console.log('实例监听对象', res)
-    },
-    // 接收上传错误信息
-    error(err:any) {
-        switch (err.code) {
-            case 413:
-                ElMessage.error('错了哦,图片可能太大了哦')
-                break
-            case 408:
-                ElMessage.error('错了哦,请求超时')
-                break
-            default:
-                ElMessage.error('错了哦,上传错误')
+        next(res: any) {
+            console.log('实例监听对象', res)
+        },
+        // 接收上传错误信息
+        error(err: any) {
+            switch (err.code) {
+                case 413:
+                    ElMessage.error('错了哦,图片可能太大了哦')
+                    break
+                case 408:
+                    ElMessage.error('错了哦,请求超时')
+                    break
+                default:
+                    ElMessage.error('错了哦,上传错误')
+            }
+        },
+        // 接收上传完成后的信息
+        complete(com: any) {
+            let ERPOSS = import.meta.env.VITE_BZD_ERPOSS_APP_API
+            emits('update:upImg',ERPOSS+com.key);
         }
-    },
-    // 接收上传完成后的信息
-    complete(com:any) {
-        console.log('七牛云返回',com)
-    }
-};
-observable.subscribe(observer);
+    };
+    observable.subscribe(observer);
 }
 
 //删除
-const clickDel = async (e:any)=>{
-    console.log('删除',e)
-    emits('update:upImg','');
+const clickDel = async (e: any) => {
+    emits('update:upImg', '');
+}
+//函数
+const clickShow = async ()=>{
+    dialogVisible.value = true
 }
-
 </script>
 <style lang="scss">
 /* @import url(); 引入css类 */
@@ -164,7 +177,11 @@ const clickDel = async (e:any)=>{
             width: 100%;
             height: 100%;
             background: rgba(#000, 0.5);
+            display: flex;
+            align-items: center;
+            justify-content: center;
         }
     }
 
-}</style>
+}
+</style>

+ 5 - 1
src/hooks/useTablePublic.ts

@@ -56,7 +56,11 @@ export const Project_F_State = [
   { id: 3, name: '已完成' },
   { id: 4, name: '已发绩效' }
 ]
-
+export const ReimburseFrom_F_State = [
+  { T_State: 2, name: '待审核' },
+  { T_State: 3, name: '审核通过' },
+  { T_State: 4, name: '审核不通过' },
+]
 export const columns = [
   { type: 'index', label: '序号', width: 80, align: 'center ' },
   { label: '产品图片', prop: 'T_img', align: 'center ', name: 'T_img' },

+ 3 - 1
src/views/salary/Reimburse/Reimburse.vue

@@ -32,7 +32,9 @@ const tableRowClassNameHandle = (data: any): any => tableRowClassName(data.row.T
 // 搜索以及参数
 const columns: ColumnProps[] = [
   { prop: 'T_name', label: '姓名' },
-  { prop: 'T_post_name', label: '职位' }
+  // { prop: 'T_post_name', label: '职位' },
+  { prop: 'T_wait_audit', label: '状态' }
+
 ]
 
 const searchs = reactive({

+ 29 - 9
src/views/salary/Reimburse/ReimburseFrom.vue

@@ -8,12 +8,22 @@
         <el-table-column :show-overflow-tooltip="true" prop="T_remit" label="打款金额" width="100" />
         <el-table-column :show-overflow-tooltip="true" prop="T_State" label="状态" width="150">
           <template #default="scope">
-              <el-tag v-if="scope.row.T_State == 1" class="ml-2" type="danger">未提交审核</el-tag>
-              <el-tag v-if="scope.row.T_State == 2" class="ml-2" type="warning">待审核</el-tag>
-              <el-tag v-if="scope.row.T_State == 3">审核通过</el-tag>
-              <el-tag v-if="scope.row.T_State == 4" class="ml-2" type="danger">审核不通过</el-tag>
-              <el-tag v-if="scope.row.T_State == 5" type="warning">已部分打款</el-tag>
-              <el-tag v-if="scope.row.T_State == 6">已全部打款</el-tag>
+            <el-dropdown trigger="click" size="small">
+              <el-button type="primary" size="small" :disabled="scope.row.T_State === 5 || scope.row.T_State === 6 || scope.row.T_State === 3">
+                {{ ['待审核', '审核通过', '审核不通过','已部分打款','已全部打款'][scope.row.T_State-2] }}
+                <el-icon class="el-icon--right"><arrow-down /></el-icon>
+              </el-button>
+              <template #dropdown>
+                <el-dropdown-menu>
+                  <el-dropdown-item
+                    v-for="item in ReimburseFrom_F_State"
+                    :key="item.T_State"
+                    @click="changeState(item.T_State, scope.row)"
+                    >{{ item.name }}</el-dropdown-item
+                  >
+                </el-dropdown-menu>
+              </template>
+            </el-dropdown>
           </template>
         </el-table-column>
         <el-table-column :show-overflow-tooltip="true" prop="T_date" label="提交日期" width="220" />
@@ -88,7 +98,7 @@
             </el-table-column>
             <el-table-column label="附件" min-width="80">
               <template #default="scope">
-                <img :src="scope.row.T_img" style="width: 50px;height: 50px;">
+                <upImg v-model:upImg="scope.row.T_img" :imgData="scope.row.T_img" :disabled="true"></upImg>
               </template>
             </el-table-column>
           </el-table>
@@ -140,9 +150,10 @@
 </template>
 <script lang="ts" setup>
 import { reactive,computed ,watch} from "vue";
-import { Reimburse_Get,Reimburse_List ,Reimburse_Edit} from '@/api/Reimburse/index'
+import { Reimburse_Get,Reimburse_List ,Reimburse_Edit,Reimburse_Audit} from '@/api/Reimburse/index'
 import { ElMessage } from 'element-plus'
-
+import { ReimburseFrom_F_State } from '@/hooks/useTablePublic'
+import upImg from '@/components/upImg/upimg.vue'
 // 接受父组件参数,配置默认值
 const props = defineProps<{
   fromDatas:{
@@ -206,6 +217,15 @@ const Reimburse_GetApi = async ()=>{
   
   data.total = res.Data.Num
 }
+//函数
+const changeState = async (id: number, row: any) => {
+  console.log('点击',id,row)
+  const res: any = await Reimburse_Audit({T_id: row.Id, T_State: id })
+  if (res.Code === 200) {
+    ElMessage.success('ok,操作成功!')
+    Reimburse_GetApi()
+  }
+}
 
 //函数
 const subFun = async ()=>{

+ 20 - 15
src/views/salary/ReimburseMy.vue

@@ -44,7 +44,7 @@
             <el-form :model="data.fromData" label-position="top">
                 <el-form-item label="报销总金额">
                     <div style="display: flex;">
-                        <el-input v-model.number="data.fromData.T_money" style="flex: 1;"
+                        <el-input v-model.number="T_money" style="flex: 1;"
                             :disabled="data.drawerTiti == '详情' ? true : false" />
                         <span style="padding-left: 20px;">元</span>
                     </div>
@@ -112,19 +112,9 @@
                             </template>
                         </el-table-column>
 
-                        <el-table-column label="附件" :min-width="data.drawerTiti != '详情' ? '800' : ''">
+                        <el-table-column label="附件" :min-width="data.drawerTiti != '详情' ? '80' : ''">
                             <template #default="scope">
-                                <!-- {{ kk }} -->
-                                <upImg v-model:upImg="scope.row.T_img" :imgData="scope.row.T_img"></upImg>
-                                <!-- <Upload ref="uploadRef" :limit="1" v-model="scope.row.T_img" accept="image/*"
-                                    style="float: left;"
-                                     :disabled="data.drawerTiti=='详情'?true:false"
-                                     :show-file-list="false">
-                                        <el-icon>
-                                            <Plus />
-                                        </el-icon>
-                                    </Upload> -->
-                                    <!-- <img :src="scope.row.T_img" style="width: 40px;margin-left: 10px;"> -->
+                                <upImg v-model:upImg="scope.row.T_img" :imgData="scope.row.T_img" :disabled="data.drawerTiti=='详情'?true:false"></upImg>
                             </template>
                         </el-table-column>
                         <el-table-column fixed="right" min-width="300" v-if="data.drawerTiti != '详情'">
@@ -175,7 +165,6 @@ import upImg from '@/components/upImg/upimg.vue'
 // import dataList from '@/plugins/reimbursemyData.js'
 
 
-const kk = ref(555)
 const data = reactive({
     //费用类型
     optionsFeeType: [{ Id: '', T_name: '',FeeDetails:[]}],
@@ -211,6 +200,22 @@ const data = reactive({
         },]
     }
 })
+
+
+const T_money = computed(()=>{
+    const arr = data.fromData.ReimburseDetails
+    const arrMoney:any = []
+    arr.forEach(item => {
+        arrMoney.push(item.T_money)
+    });
+    // const sun = 
+    data.fromData.T_money = arrMoney.reduce((n:any,m:any) => n + m)
+    console.log('计算属性',data.fromData.T_money)
+    return arrMoney.reduce((n:any,m:any) => n + m)
+    
+
+})
+
 const uploadRef = ref()
 
 const changeFun = (timeKey: any, e: any) => {
@@ -237,7 +242,7 @@ const handlePictureCardPreview = (uploadFile: any) => {
 //点击编辑/新增得确定按钮
 const subData = () => {
     console.log('编辑',data.fromData)
-    return
+    // return
     if (data.drawerTiti == '新增') {
         setAddApi()
     } else {

+ 1 - 1
tsconfig.json

@@ -19,6 +19,6 @@
     }
   },
   "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
-  
+
   "references": [{ "path": "./tsconfig.node.json" }]
 }

+ 15 - 15
vite.config.ts

@@ -30,21 +30,21 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
     server: {
       open: true,
       host: '0.0.0.0',
-      proxy: {
-        '/api': {
-          target: 'https://erp.baozhida.cn',
-          changeOrigin: true,
-          rewrite: path => path.replace(/^\/api/, '/testapi')
-        },
-        '/testapi': {
-          target: 'https://erp.baozhida.cn',
-          changeOrigin: true
-        },
-        '/ams': {
-          target: 'http://erp.baozhida.cn',
-          changeOrigin: true
-        }
-      }
+      // proxy: {//开发者模式打开
+      //   '/api': {
+      //     target: 'https://erp.baozhida.cn',
+      //     changeOrigin: true,
+      //     rewrite: path => path.replace(/^\/api/, '/testapi')
+      //   },
+      //   '/testapi': {
+      //     target: 'https://erp.baozhida.cn',
+      //     changeOrigin: true
+      //   },
+      //   '/ams': {
+      //     target: 'http://erp.baozhida.cn',
+      //     changeOrigin: true
+      //   }
+      // }
     },
     plugins: [
       vue(),