YangJian0701 1 year ago
parent
commit
b824ddf641

BIN
ERP.rar


+ 5 - 1
src/api/mypercentage/index.ts

@@ -27,4 +27,8 @@ export const percentage_Edit = (params: any) => $http.post('/storage/Percentage/
 
 
 // 员工-修改
-export const percentage_Add = (params: any) => $http.post('/storage/Percentage/Add', params)
+export const percentage_Add = (params: any) => $http.post('/storage/Percentage/Add', params)
+
+
+// 提交审核
+export const percentage_Submit_Audit = (params: any) => $http.post('/storage/Percentage/Submit_Audit', params)

+ 14 - 0
src/api/storehouse/index.ts

@@ -1,5 +1,19 @@
 import $http from '../index'
 
+
+/**
+ * 提成项目
+ */
+// 提成项目列表
+export const VerifyItem_List = (params: any) => $http.post('/storage/VerifyItem/List', params)
+// 提成项目添加
+export const VerifyItem_Add = (params: any) => $http.post('/storage/VerifyItem/Add', params)
+// 提成项目修改
+export const VerifyItem_Edit = (params: any) => $http.post('/storage/VerifyItem/Edit', params)
+// // 提成项目删除
+export const VerifyItem_Del = (params: any) => $http.post('/storage/VerifyItem/Del', params)
+
+
 /**
  * 仓库
  */

+ 21 - 1
src/hooks/useTablePublic.ts

@@ -46,7 +46,10 @@ export interface ContractFormType {
   T_recoveries: string
   T_invoice: string
   T_submit_name?: string
-  T_remit:any
+  T_remit:any,
+  T_approval_money: any
+  T_approval_opinion: any
+  T_State: any
 }
 export interface MyPercentageFormType {
   T_id: string
@@ -164,6 +167,23 @@ export const options1 = [
   { name: '已部分打款', id: 4 },
   { name: '已全部打款', id: 5 }
 ]
+export const options2 = [
+  { name: '待审核', id: 1 },
+  { name: '审核通过', id: 2 },
+  { name: '审核不通过', id: 3 },
+  { name: '已部分打款', id: 4 },
+  { name: '已全部打款', id: 5 },
+  { name: '未提交审核', id: 6 }
+]
+export const options3 = [
+  { name: '验证实施', id: 1 },
+  { name: '报告编写', id: 2 },
+]
+export function useStapublicFun(data:any){
+  const a = options2.find((item:any)=>item.id == data)
+  return a?.name
+
+}
 export function useTablePublic() {
   const globalStore = GlobalStore()
   const validate_T_product = (rule: any, value: any, callback: any) => {

+ 17 - 4
src/views/storehouse/sales/MyPercentage.vue

@@ -4,10 +4,10 @@ import { useRouter } from 'vue-router'
 import { fnMd5 } from '@/utils/common'
 import { ElMessageBox, ElMessage } from 'element-plus'
 import TableBase from '@/components/TableBase/index.vue'
-import {Finished, View,Edit,Delete } from '@element-plus/icons-vue'
+import {Finished, View,Edit,Delete,Check } from '@element-plus/icons-vue'
 import type { ColumnProps } from '@/components/TableBase/interface/index'
-import {percentage_UserList,percentage_Del } from '@/api/mypercentage/index'
-import { useTablePublic, options1} from '@/hooks/useTablePublic'
+import {percentage_UserList,percentage_Del,percentage_Submit_Audit } from '@/api/mypercentage/index'
+import { useTablePublic, options2} from '@/hooks/useTablePublic'
 const { updateOnTableList } = useTablePublic()
 const router = useRouter()
 const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
@@ -22,6 +22,7 @@ const columns: ColumnProps[] = [
   { prop: 'T_type', label: '提成类型', name: 'T_type' },
   { prop: 'T_uuid_name', label: '提成人员' },
   { prop: 'T_money', label: '提成金额' },
+  { prop: 'T_approval_money', label: '审批金额' },
   { prop: 'T_State', label: '状态', name: 'T_State' },
   { prop: 'T_send_money', label: '已发提成金额' },
   { prop: 'operation', label: '操作', width: 260, fixed: 'right' }
@@ -31,6 +32,17 @@ const processContract = (id: string,titles:string) => {
   router.push({ name: 'PercentageDetail', params: { id, type: fnMd5('contract'),titles:titles}})
 }
 
+
+//函数
+const SubmitReview = async (row:any)=>{
+  const reslut:any = await percentage_Submit_Audit({T_id:row.Id})
+  console.log('审核',reslut,row)
+  if(reslut.Code==200 && reslut.Msg=='ok!'){
+      searchOnTableList(TableRef.value)
+      ElMessage.success(reslut.Msg)
+    }
+}
+
 const initParam = reactive({
   User_tokey: globalStore.GET_User_tokey,
   T_name: '',
@@ -82,7 +94,7 @@ const processdel =  (id:any)=>{
             <el-col :xl="5" :md="6">
               <span class="inline-flex items-center">状态:</span>
               <el-select v-model="initParam.T_state" class="w-50" clearable placeholder="请选择状态~">
-                <el-option v-for="item in options1" :key="item.id" :label="item.name" :value="item.id" />
+                <el-option v-for="item in options2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-col>
             <el-col :xl="6" :md="2" class="btn"> 
@@ -111,6 +123,7 @@ const processdel =  (id:any)=>{
         <el-tag v-else type="danger" effect="dark"> --- </el-tag>
       </template>
       <template #right="{ row }"> 
+        <el-button link type="primary" size="small" :disabled="![3,6].includes(row.T_State)" :icon="Check" @click="SubmitReview( row)">提交审核</el-button>
         <el-button link type="primary" size="small" :disabled="![1,3].includes(row.T_State)" :icon="Edit" @click="openContractFormDrawer('edit', row)">编辑</el-button>
         <el-button link type="success" size="small"  :icon="View" @click="processContract(row.Id,'详情')">详情</el-button>
         <el-button link type="danger" size="small" :disabled="![1,3].includes(row.T_State)"  :icon="Delete" @click="processdel(row.Id)">删除</el-button>

+ 5 - 2
src/views/storehouse/sales/Percentage.vue

@@ -7,7 +7,7 @@ import TableBase from '@/components/TableBase/index.vue'
 import { Edit, Delete, Finished, View } from '@element-plus/icons-vue'
 import type { ColumnProps } from '@/components/TableBase/interface/index'
 import { percentage_List, percentage_User_List } from '@/api/percentage/index'
-import { useTablePublic, options1} from '@/hooks/useTablePublic'
+import { useTablePublic, options2} from '@/hooks/useTablePublic'
 
 const router = useRouter()
 const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
@@ -22,6 +22,9 @@ const columns: ColumnProps[] = [
   { prop: 'T_type', label: '提成类型', name: 'T_type' },
   { prop: 'T_uuid_name', label: '提成人员' },
   { prop: 'T_money', label: '提成金额' },
+  { prop: 'T_approval_money', label: '审批金额' },
+
+  
   { prop: 'T_send_money', label: '已发提成金额' },
   { prop: 'T_State', label: '状态', name: 'T_State' },
   { prop: 'operation', label: '操作', width: 260, fixed: 'right' }
@@ -106,7 +109,7 @@ const ContractForm = defineAsyncComponent({
             <el-col :xl="5" :md="6">
               <span class="inline-flex items-center">状态:</span>
               <el-select v-model="initParam.T_state" class="w-50" clearable placeholder="请选择状态~">
-                <el-option v-for="item in options1" :key="item.id" :label="item.name" :value="item.id" />
+                <el-option v-for="item in options2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-col>
             <el-col :xl="6" :md="2" class="btn"> <el-button type="primary"

+ 22 - 1
src/views/storehouse/sales/PercentageDetail.vue

@@ -12,7 +12,8 @@ import PercentageTable from './PercentageTable.vue'
 import {
   royalty,
   columnsRemit,
-  labelsInvoice
+  labelsInvoice,
+  useStapublicFun
 } from '@/hooks/useTablePublic'
 interface InfoType {
   Id: number
@@ -38,6 +39,8 @@ interface InfoType {
   T_project: string
   T_no_recoveries_money: number
   T_no_invoice_money: number
+  T_approval_money: any
+  T_approval_opinion: any
 }
 
 const route = useRoute()
@@ -272,6 +275,24 @@ const InvoiceRef = ref<InstanceType<typeof PercentageTable> | null>(null)
           </el-col>
         </el-row>
         <el-row>
+          <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>审批金额</span></el-col>
+          <el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
+            <div>{{ info?.T_approval_money }}</div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>审批意见</span></el-col>
+          <el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
+            <div>{{ info?.T_approval_opinion }}</div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>状态</span></el-col>
+          <el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
+            <div>{{ useStapublicFun(info?.T_State) }}</div>
+          </el-col>
+        </el-row>
+        <el-row>
           <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>打款明细</span></el-col>
           <el-col :span="21">
             <PercentageTable ref="InvoiceRef" :columns="columnsRemit" :showTable="false" title="打款明细" :labels="labelsInvoice">

+ 22 - 2
src/views/storehouse/sales/PercentageForm.vue

@@ -5,8 +5,10 @@ import {
   ContractFormType,
   useTablePublic,
   columnsRemit,
-  labelsInvoice
+  labelsInvoice,
+  useStapublicFun
 } from '@/hooks/useTablePublic'
+
 import {
   Storehouse_Contract_Gen_Number
 } from '@/api/storehouse/index'
@@ -79,7 +81,10 @@ const form = reactive<ContractFormType>({
   T_recoveries: '',
   T_remit: '',
   T_invoice:'',
-  T_submit_name: ''
+  T_submit_name: '',
+  T_approval_money: '',
+  T_approval_opinion: '',
+  T_State: null
 })
 
 const openDrawer = (type: string, row?: any) => {
@@ -93,6 +98,7 @@ const openDrawer = (type: string, row?: any) => {
 }
 // edit data echo
 const editDataEcho = async (row: any) => {
+  console.log('编辑',row)
   form.T_uuid = row.T_submit
   form.T_pdf = row.T_pdf
   form.T_date = row.T_date
@@ -104,11 +110,16 @@ const editDataEcho = async (row: any) => {
   form.T_number = row.T_number
   form.T_customer = row.T_customer
 
+  form.T_approval_money = row.T_approval_money
+  form.T_approval_opinion = row.T_approval_opinion
+  form.T_State = row.T_State
+
   const res: any = await percentage_Get({
     User_tokey,
     T_id: row.Id
   })
   if (res.Code === 200) {
+    console.log('打款明细',res)
     const { T_Product, T_remit, T_recoveries, T_remark,T_item } = res.Data
     form.T_remark = T_remark
     T_Product && (tableData.value = T_Product.map((item: any) => {
@@ -312,6 +323,15 @@ defineExpose({
         <el-form-item label="提成人员:" :label-width="formLabelWidth" prop="T_customer">
           {{ form.T_uuid_name}}
         </el-form-item>
+        <el-form-item label="审批金额:" :label-width="formLabelWidth" prop="T_customer">
+          {{ form.T_approval_money}}
+        </el-form-item>
+        <el-form-item label="审批意见:" :label-width="formLabelWidth" prop="T_customer">
+          {{ form.T_approval_opinion}}
+        </el-form-item>
+        <el-form-item label="状态:" :label-width="formLabelWidth" prop="T_customer">
+          {{ useStapublicFun(form?.T_State) }}
+        </el-form-item>
         <el-form-item label="打款明细:" :label-width="formLabelWidth" prop="T_remit">
           <PercentageTable ref="InvoiceRef" :columns="columnsRemit" :showTable="props.ContForm.showTable?true:false" title="打款明细" :labels="labelsInvoice">
             <template #add="{ AddDetail }">

+ 210 - 0
src/views/storehouse/verifyItem.vue

@@ -0,0 +1,210 @@
+<script setup lang="ts">
+import {
+  VerifyItem_List,
+  VerifyItem_Add,
+  VerifyItem_Edit,
+  VerifyItem_Del,
+} from '@/api/storehouse/index'
+import { ref, reactive, nextTick } from 'vue'
+import Upload from '@/components/Upload/index.vue'
+import Drawer from '@/components/Drawer/index.vue'
+import TableBase from '@/components/TableBase/index.vue'
+import { ElMessageBox, ElMessage } from 'element-plus'
+import type { FormInstance, FormRules } from 'element-plus'
+import { Edit, Delete, Plus } from '@element-plus/icons-vue'
+import type { ColumnProps } from '@/components/TableBase/interface/index'
+import ImageCom from '@/components/Image/index.vue'
+import { useTablePublic,options3 } from '@/hooks/useTablePublic'
+
+const isNew = ref(true)
+const formLabelWidth = ref('100px')
+const ruleFormRef = ref<FormInstance>()
+const drawerRef = ref<InstanceType<typeof Drawer> | null>(null)
+const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
+const uploadRef = ref<InstanceType<typeof Upload> | null>(null)
+const { resetForm, globalStore, searchOnTableList, updateOnTableList } = useTablePublic()
+
+const columns: ColumnProps[] = [
+  { type: 'index', label: '序号', width: 80 },
+  { prop: 'T_name', label: '项目名称' },
+  { prop: 'T_type', label: '类型' , name: 'T_type'},
+  { prop: 'T_price', label: '金额(元)' },
+  { prop: 'operation', label: '操作', width: 150, fixed: 'right' }
+]
+
+const rules = reactive<FormRules>({
+  T_name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
+  T_type: [{ required: true, message: '请选择类型', trigger: 'blur' }],
+  T_price: [{ required: true, message: '请输入金额', trigger: 'blur' }],
+})
+const form:any = ref({
+  T_id:'',
+  T_name: '',
+  T_type: 1,
+  T_price: '',
+})
+
+const openDrawer = (type: string, row?: any) => {
+  isNew.value = type === 'new' ? true : false
+  if(type == 'edit'){
+    form.value.T_id = row.Id
+    form.value.T_name = row.T_name
+    form.value.T_type = row.T_type
+    form.value.T_price = row.T_price
+  }else{
+    delete form.value.T_id
+    form.value.T_name = ''
+    form.value.T_type = 1
+    form.value.T_price =''
+  }
+  drawerRef.value?.openDrawer()
+}
+
+const AddProduction = (formEl: FormInstance | undefined) => {
+  if (!formEl) return
+  formEl.validate(async valid => {
+    if (valid) {
+      let res: any = {}
+      if (isNew.value) {//新增
+        res = await VerifyItem_Add({ User_tokey: globalStore.GET_User_tokey, ...form.value })
+      } else {//编辑
+        res = await VerifyItem_Edit({
+          User_tokey: globalStore.GET_User_tokey,
+          ...form.value,
+        })
+      }
+      if (res.Code === 200) {
+        ElMessage.success(`提成项目${isNew.value ? '添加' : '修改'}成功!!`)
+        nextTick(() => {
+          drawerRef.value?.closeDrawer()
+          updateOnTableList(TableRef.value)
+          resetForm(ruleFormRef.value)
+          isNew.value = true
+        })
+      }
+    } else {
+      return false
+    }
+  })
+}
+
+const ProductDelete = (row: any) => {
+  ElMessageBox.confirm('您确定要删除该提成项目吗?', '警告', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(async () => {
+      const res: any = await VerifyItem_Del({
+        User_tokey: globalStore.GET_User_tokey,
+        T_id: row.Id
+      })
+      if (res.Code === 200) {
+        ElMessage.success('删除成功!')
+        nextTick(() => updateOnTableList(TableRef.value))
+      }
+    })
+    .catch(() => {
+      ElMessage.warning('取消成功!')
+    })
+}
+
+const callbackDrawer = (done: () => void) => {
+  resetForm(ruleFormRef.value)
+  uploadRef.value?.clearfileList()
+  done()
+}
+// 搜索
+const initParam = reactive({
+  User_tokey: globalStore.GET_User_tokey,
+  T_name: '',
+  T_type: ''
+})
+</script>
+
+<template>
+  <div class="production-list">
+    <TableBase ref="TableRef" :columns="columns" :requestApi="VerifyItem_List" :initParam="initParam">
+      <template #table-header>
+        <div class="input-suffix">
+          <el-row :gutter="20" style="margin-bottom: 0">
+            <el-col :xl="6" :lg="8" :md="10">
+              <span class="inline-flex items-center">项目名称:</span>
+              <el-input
+                v-model="initParam.T_name"
+                type="text"
+                class="w-50 m-2"
+                placeholder="按产品名称、产品型号搜索"
+                @change="searchOnTableList(TableRef)"
+              />
+            </el-col>
+            <el-col :xl="10" :md="12">
+              <span class="inline-flex items-center">类型:</span>
+              <el-select v-model="initParam.T_type" class="w-50 m-2" clearable placeholder="请选择分类~">
+                <el-option v-for="item in options3" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+              <el-button type="primary" @click="searchOnTableList(TableRef)">搜索</el-button>
+            </el-col>
+            <el-col :xl="6" :md="2" class="btn"
+              ><el-button type="primary" @click="openDrawer('new')">添加</el-button></el-col
+            >
+          </el-row>
+        </div>
+      </template>
+      <template #T_type="{ row }">
+        <el-tag :type="row.T_type === 1?'success':'primary'" effect="dark">{{row.T_type === 1?'验证实施':'报告编写'}}</el-tag>
+      </template>
+      <template #right="{ row }">
+        <el-button link type="primary" size="small" :icon="Edit" @click="openDrawer('edit', row)">编辑</el-button>
+        <el-button link type="danger" size="small" :icon="Delete" @click="ProductDelete(row)">删除</el-button>
+      </template>
+    </TableBase>
+    <Drawer ref="drawerRef" :handleClose="callbackDrawer">
+      <template #header="{ params }">
+        <h4 :id="params.titleId" :class="params.titleClass">{{ isNew ? '添加' : '编辑' }} - 提成项目</h4>
+      </template>
+      <el-form ref="ruleFormRef" :model="form" :rules="rules">
+        <el-form-item label="项目名称:" class="m-b-6" :label-width="formLabelWidth" prop="T_name">
+          <el-input v-model="form.T_name" type="text" autocomplete="off" placeholder="请填写项目名称" />
+        </el-form-item>
+        <el-form-item label="类型:" class="m-b-6" :label-width="formLabelWidth" prop="T_type">
+          <el-radio-group v-model="form.T_type" class="ml-4">
+            <el-radio :label="item.id" v-for="item,index in options3">{{item.name}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="金额:" class="m-b-6" :label-width="formLabelWidth" prop="T_price">
+          <el-input v-model="form.T_price" type="text" autocomplete="off" placeholder="请填写金额" />
+        </el-form-item>
+        
+        <el-form-item :label-width="formLabelWidth">
+          <el-button v-if="isNew" color="#626aef" @click="AddProduction(ruleFormRef)">提交</el-button>
+          <el-button v-else color="#626aef" @click="AddProduction(ruleFormRef)">修改</el-button>
+        </el-form-item>
+      </el-form>
+    </Drawer>
+  </div>
+</template>
+
+<style scoped lang="scss">
+@import '@/styles/var.scss';
+.tooltip-content {
+  max-width: 500px;
+  overflow-y: auto;
+}
+.production-list {
+  @include f-direction;
+  .input-suffix {
+    width: 100%;
+    .inline-flex {
+      white-space: nowrap;
+    }
+    .btn {
+      display: flex;
+      justify-content: end;
+    }
+    .w-50 {
+      width: 12.5rem;
+    }
+  }
+}
+</style>