duy 2 жил өмнө
parent
commit
17a8e2379e

+ 38 - 1
src/views/expense/purchaseRequest/record.vue

@@ -152,6 +152,29 @@ const getApi = () => {
         getDetailsData()
     } else {
         totalFrMoney.value = '0'
+        //基础详情
+        const detailsObj = {
+            purDesc: '', // 申请事由
+            purType: null, // 采购类型
+            useOrgName: '', // 使用单位或部门
+            remarks: '', // 备注
+            expectedDeliveryDate: null, // 期望交付日期
+            cashierUser: {}, // 出纳人
+            ccUserList: {}, // 抄送人列表
+            finalConfirmationUser: {}, // 最终确认付款人
+            financeUser: {}, // 财务人员
+            responsibleUser: {}, // 部门负责人
+            //details: [detailsObj1],
+        }
+
+        //明细
+        const detailsObj1 = {
+            purName: '', // 采购名称
+            purSpecification: '', // 采购规格
+            purCount: '', // 采购数量
+            purOrgName: '', // 采购数量单位
+            purPrice: null, // 采购价格
+        }
         detailsData.value = {
             ...detailsObj,
             details: [detailsObj1],
@@ -209,7 +232,21 @@ const formRules = {
 const formItemRules = {
     purName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
     purSpecification: [{ required: true, message: '请输入规格', trigger: 'blur' }],
-    purCount: [{ required: true, message: '请输入数量', trigger: 'blur' }],
+    // purCount: [{ required: true, message: '请输入数量', trigger: 'blur' }],
+    purCount: [{
+        validator: (rule, value, callback) => {
+            if (value) {
+                if (value.length > 10) {
+                    callback(new Error('输入字符长度过长'))
+                } else {
+                    callback()
+                }
+            } else {
+                callback()
+            }
+        },
+        trigger: 'blur',
+    }],
     purOrgName: [{ required: true, message: '请输入单位', trigger: 'blur' }],
     purPrice: [{ required: true, message: '请输入价格', trigger: 'blur' }],
 }

+ 141 - 131
src/views/home/task/task-details.vue

@@ -1,9 +1,13 @@
 <template>
-    <HcCard scrollbar actionUi="text-center">
+    <HcCard scrollbar action-ui="text-center">
         <HcCardItem>
             <div class="hac-task-name-box">
-                <div class="label">任务名称</div>
-                <div class="name">{{ taskBasicsInfo?.taskName }}</div>
+                <div class="label">
+                    任务名称
+                </div>
+                <div class="name">
+                    {{ taskBasicsInfo?.taskName }}
+                </div>
             </div>
             <div class="hac-task-text-box">
                 <span>上报类型:{{ taskBasicsInfo?.ReportTypeName }}</span>
@@ -12,125 +16,132 @@
             </div>
         </HcCardItem>
 
-        <HcCardItem title="任务详情" class="mt-4"  v-if="dataType=='任务审批'||dataType=='财务报销'||dataType=='出差申请'||dataType=='流转财务审核'||dataType=='报销审批'">
+        <HcCardItem v-if="dataType == '任务审批' || dataType == '财务报销' || dataType == '出差申请' || dataType == '流转财务审核' || dataType == '报销审批'" title="任务详情" class="mt-4">
             <div class="h-52">
-                <HcTable :isIndex="false" :column="tableColumn" :datas="tableData"/>
+                <HcTable :is-index="false" :column="tableColumn" :datas="tableData" />
             </div>
         </HcCardItem>
 
-        <HcCardItem title="操作任务" class="mt-4" v-if="dataType === '任务审批'">
-            <el-form ref="formRef" :model="otherInfo"  label-width="" disabled>
-                            <el-form-item label="变更类别:" prop="updateType" size="large">
-                                <el-radio-group v-model="otherInfo.updateType" size="large">
-                                    <el-radio :label="1">已完成</el-radio>
-                                    <el-radio :label="2" class="ml-8">任务转移</el-radio>
-                                </el-radio-group>
-                            </el-form-item>
-                            <el-form-item label="完成时间:" prop="completionTime" class="w-72" v-if="otherInfo.updateType === 1">
-                                <el-date-picker class="block" v-model="otherInfo.completionTime" format="YYYY-MM-DD HH:mm:ss" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"/>
-                            </el-form-item>
-                            <template v-if="otherInfo.updateType === 2">
-                                <el-form-item label="转移时间:" prop="transfer" class="w-72">
-                                    <el-date-picker class="block" v-model="otherInfo.completionTime" format="YYYY-MM-DD HH:mm:ss" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"/>
-                                </el-form-item>
-                                <el-form-item label="转移对象:" prop="type" size="large">
-                                    <el-select class="block" v-model="otherInfo.transferObject"  filterable allow-create default-first-option :reserve-keyword="false">
-                                        <el-option v-for="item in userList" :label="item.name" :value="item.id"/>
-                                    </el-select>
-                                </el-form-item>
-                                <el-form-item label="转移原因:" prop="textContent">
-                                    <el-input v-model="otherInfo.transferReason" :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入文字说明" type="textarea"/>
-                                </el-form-item>
-                            </template>
+        <HcCardItem v-if="dataType === '任务审批'" title="操作任务" class="mt-4">
+            <el-form ref="formRef" :model="otherInfo" label-width="" disabled>
+                <el-form-item label="变更类别:" prop="updateType" size="large">
+                    <el-radio-group v-model="otherInfo.updateType" size="large">
+                        <el-radio :label="1">
+                            已完成
+                        </el-radio>
+                        <el-radio :label="2" class="ml-8">
+                            任务转移
+                        </el-radio>
+                    </el-radio-group>
+                </el-form-item>
+                <el-form-item v-if="otherInfo.updateType === 1" label="完成时间:" prop="completionTime" class="w-72">
+                    <el-date-picker v-model="otherInfo.completionTime" class="block" format="YYYY-MM-DD HH:mm:ss" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" />
+                </el-form-item>
+                <template v-if="otherInfo.updateType === 2">
+                    <el-form-item label="转移时间:" prop="transfer" class="w-72">
+                        <el-date-picker v-model="otherInfo.completionTime" class="block" format="YYYY-MM-DD HH:mm:ss" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" />
+                    </el-form-item>
+                    <el-form-item label="转移对象:" prop="type" size="large">
+                        <el-select v-model="otherInfo.transferObject" class="block" filterable allow-create default-first-option :reserve-keyword="false">
+                            <el-option v-for="item in userList" :label="item.name" :value="item.id" />
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item label="转移原因:" prop="textContent">
+                        <el-input v-model="otherInfo.transferReason" :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入文字说明" type="textarea" />
+                    </el-form-item>
+                </template>
             </el-form>
         </HcCardItem>
 
-        <HcCardItem title="数据详情" class="mt-4"  v-if="dataType!=='任务审批'">
-             <!-- 报销 -->
-            <div class="hc-info-list" v-if="dataType=='报销审批'">
-                <HcListItem title="报销金额:" :content="otherInfo?.frMoney"/>
-                <HcListItem title="发生日期:" :content="otherInfo?.frDate"/>
-                <HcListItem title="费用类型:" :content="otherInfo?.frTypeName"/>
-                <HcListItem title="费用说明:" :content="otherInfo?.frDesc"/>
-                <HcListItem title="电子发票:" >
-                    <HcImg ui="img" :index="0"
-                    v-if="otherInfo?.frElectronicInvoiceUrl"
-                           :src="otherInfo?.frElectronicInvoiceUrl"
-                           :srcs="[otherInfo?.frElectronicInvoiceUrl]"
+        <HcCardItem v-if="dataType !== '任务审批'" title="数据详情" class="mt-4">
+            <!-- 报销 -->
+            <div v-if="dataType == '报销审批'" class="hc-info-list">
+                <HcListItem title="报销金额:" :content="otherInfo?.frMoney" />
+                <HcListItem title="发生日期:" :content="otherInfo?.frDate" />
+                <HcListItem title="费用类型:" :content="otherInfo?.frTypeName" />
+                <HcListItem title="费用说明:" :content="otherInfo?.frDesc" />
+                <HcListItem title="电子发票:">
+                    <HcImg
+                        v-if="otherInfo?.frElectronicInvoiceUrl" ui="img"
+                        :index="0"
+                        :src="otherInfo?.frElectronicInvoiceUrl"
+                        :srcs="[otherInfo?.frElectronicInvoiceUrl]"
                     />
-          
                 </HcListItem>
-                <HcListItem title="附件文件:" >
-                    <HcImg ui="img" :index="0"
-                    v-if="otherInfo?.frElectronicInvoiceUrl"
-                            :src="otherInfo?.frAttachmentUrl"
-                           :srcs="[otherInfo?.frAttachmentUrl]"
+                <HcListItem title="附件文件:">
+                    <HcImg
+                        v-if="otherInfo?.frElectronicInvoiceUrl" ui="img"
+                        :index="0"
+                        :src="otherInfo?.frAttachmentUrl"
+                        :srcs="[otherInfo?.frAttachmentUrl]"
                     />
-        
                 </HcListItem>
-                <HcListItem title="归属人:" :content="otherInfo?.userNameVesting"/>
-                <HcListItem title="备注信息:" content="备注数据"/>
+                <HcListItem title="归属人:" :content="otherInfo?.userNameVesting" />
+                <!-- <HcListItem title="备注信息:" content="备注数据"/> -->
             </div>
-             <!-- 出差审批 -->
-            <div class="hc-info-list" v-if="dataType==='出差审批'">
-                <tripInfo :other-info="otherInfo"/>
+            <!-- 出差审批 -->
+            <div v-if="dataType === '出差审批'" class="hc-info-list">
+                <tripInfo :other-info="otherInfo" />
             </div>
-             <!-- 支付申请 -->
-            <div class="hc-info-list" v-if="dataType==='支付审批'">
-                <paymentRequest :other-info="otherInfo"/>
+            <!-- 支付申请 -->
+            <div v-if="dataType === '支付审批'" class="hc-info-list">
+                <paymentRequest :other-info="otherInfo" />
             </div>
-              <!-- 借款申请 -->
-             <div class="hc-info-list" v-if="dataType==='借款审批'">
-                <loanRequest :other-info="otherInfo"/>
+            <!-- 借款申请 -->
+            <div v-if="dataType === '借款审批'" class="hc-info-list">
+                <loanRequest :other-info="otherInfo" />
             </div>
-             <!-- 采购申请 -->
-            <div class="hc-info-list" v-if="dataType==='采购审批'">
-                <purchaseRequest :other-info="otherInfo"/>
+            <!-- 采购申请 -->
+            <div v-if="dataType === '采购审批'" class="hc-info-list">
+                <purchaseRequest :other-info="otherInfo" />
             </div>
             <!-- 用车申请 -->
-            <div class="hc-info-list" v-if="dataType==='用车审批'">
-                <vehicleRequest :other-info="otherInfo"/>
+            <div v-if="dataType === '用车审批'" class="hc-info-list">
+                <vehicleRequest :other-info="otherInfo" />
             </div>
             <!-- 开票申请 -->
-            <div class="hc-info-list" v-if="dataType==='发票审批'">
-                <invoiceRequest :other-info="otherInfo"/>
+            <div v-if="dataType === '发票审批'" class="hc-info-list">
+                <invoiceRequest :other-info="otherInfo" />
             </div>
-              <!-- 外包支付 -->
-            <div class="hc-info-list" v-if="dataType==='外包支付'">
-                <outsourcing :other-info="otherInfo"/>
+            <!-- 外包支付 -->
+            <div v-if="dataType === '外包支付'" class="hc-info-list">
+                <outsourcing :other-info="otherInfo" />
             </div>
             <!-- 成本测算 -->
-            <div class="hc-info-list" v-if="dataType==='成本测算'">
-                <costBudget :other-info="otherInfo"/>
+            <div v-if="dataType === '成本测算'" class="hc-info-list">
+                <costBudget :other-info="otherInfo" />
             </div>
-           
         </HcCardItem>
   
-        <HcCardItem title="操作任务" class="mt-4" v-if="dataType !== '1' && authType">
+        <HcCardItem v-if="dataType !== '1' && authType" title="操作任务" class="mt-4">
             <HcListItem ui="items-center" title="支付状态:">
                 <el-radio-group v-model="taskBasicsInfo.payStatus" size="large">
-                    <el-radio label="1">已支付</el-radio>
-                    <el-radio label="0" class="ml-4">待支付</el-radio>
+                    <el-radio label="1">
+                        已支付
+                    </el-radio>
+                    <el-radio label="0" class="ml-4">
+                        待支付
+                    </el-radio>
                 </el-radio-group>
             </HcListItem>
         </HcCardItem>
 
         <template #action>
             <el-button size="large" type="info" hc-btn @click="goBackClick">
-                <HcIcon name="arrow-go-back"/>
+                <HcIcon name="arrow-go-back" />
                 <span v-if="tabsKey === 'to-do'">取消并返回</span>
                 <span v-else>返回</span>
             </el-button>
-            <el-button size="large" type="danger" hc-btn @click="groundsShow"   v-if="tabsKey === '1'">
-                <HcIcon name="arrow-go-forward"/>
+            <el-button v-if="tabsKey === '1'" size="large" type="danger" hc-btn @click="groundsShow">
+                <HcIcon name="arrow-go-forward" />
                 <span>驳回申请</span>
             </el-button>
-            <el-button size="large" type="primary" hc-btn @click="doubleClick"  v-if="tabsKey === '1'">
-                <HcIcon name="check-double"/>
+            <el-button v-if="tabsKey === '1'" size="large" type="primary" hc-btn @click="doubleClick">
+                <HcIcon name="check-double" />
                 <span>审核通过</span>
             </el-button>
 
-            <!--模拟效果-->
+            <!-- 模拟效果 -->
             <!-- <div class="w-36 mx-6 inline-block">
                 <el-select v-model="dataType" block placeholder="选择模拟类型" size="large">
                     <el-option label="任务详情" value="任务审批"/>
@@ -148,22 +159,21 @@
             <!-- <el-button hc-btn @click="authTypeClick">模拟财务审核</el-button> -->
         </template>
 
-        <HcDialog bgColor="#ffffff" isToBody :loading="groundsLoading" :show="groundsModal" title="请填写驳回理由" widths="600px" @close="closeGroundsClick" @save="saveGroundsClick">
+        <HcDialog bg-color="#ffffff" is-to-body :loading="groundsLoading" :show="groundsModal" title="请填写驳回理由" widths="600px" @close="closeGroundsClick" @save="saveGroundsClick">
             <el-form ref="formGroundsRef" :model="formGroundsModel" :rules="formGroundsRules" label-width="0" size="large">
                 <el-form-item prop="rejectDesc">
-                    <el-input v-model="formGroundsModel.rejectDesc" :autosize="{ minRows: 6, maxRows: 10 }" placeholder="请输入驳回理由" type="textarea"/>
+                    <el-input v-model="formGroundsModel.rejectDesc" :autosize="{ minRows: 6, maxRows: 10 }" placeholder="请输入驳回理由" type="textarea" />
                 </el-form-item>
             </el-form>
         </HcDialog>
-
     </HcCard>
 </template>
 
 <script setup>
-import {onActivated, ref} from "vue";
-import {useRouter, useRoute} from 'vue-router'
-import taskApi from '~api/home/task.js';
-import {getArrValue,getObjValue,formValidate} from "js-fast-way"
+import { onActivated, ref } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+import taskApi from '~api/home/task.js'
+import { formValidate, getArrValue, getObjValue } from 'js-fast-way'
 import tripInfo from './components/trip-info.vue'//出差申请
 import paymentRequest from './components/pay-request.vue'
 import loanRequest from './components/loan-request.vue' 
@@ -172,9 +182,9 @@ import vehicleRequest from './components/vehicle-request.vue'
 import invoiceRequest from './components/invoice-request.vue' 
 import outsourcing from './components/outsourcing.vue'
 import costBudget from './components/cost-budget.vue'
-import {useAppStore} from "~src/store";
-import { getdepartmentList,getuserList} from "~api/other";
-const useAppState = useAppStore();
+import { useAppStore } from '~src/store'
+import { getdepartmentList, getuserList } from '~api/other'
+const useAppState = useAppStore()
 
 
 //初始变量
@@ -188,7 +198,7 @@ const authType = ref(false)//是否是财务人员
 //缓存页面被激活时
 onActivated(() => {
     tabsKey.value = useRoutes?.query?.tabsKey ?? ''
-    console.log( tabsKey.value,' tabsKey.value');
+    console.log( tabsKey.value, ' tabsKey.value')
     dataType.value = useRoutes?.query?.type ?? ''
     dataId.value = useRoutes?.query?.id ?? ''
     getUserDict()
@@ -196,9 +206,9 @@ onActivated(() => {
 
 })
 //获取所有员工
-const userList=ref([])
-const getUserDict=async()=>{
-    const {error, code, data} = await getuserList({tenantId:useAppState.tenantId})
+const userList = ref([])
+const getUserDict = async ()=>{
+    const { error, code, data } = await getuserList({ tenantId:useAppState.tenantId })
     if (!error && code === 200) {
         userList.value = getArrValue(data)
 
@@ -210,24 +220,24 @@ const getUserDict=async()=>{
 const authTypeClick = () => {
     authType.value = !authType.value
 }
-const taskDetail=ref({})
-const taskBasicsInfo=ref({})//基础信息
-const otherInfo=ref({})
-const getTaskDatail=async()=>{
-    const {error, code, data} = await taskApi.getDetail({id: dataId.value})
+const taskDetail = ref({})
+const taskBasicsInfo = ref({})//基础信息
+const otherInfo = ref({})
+const getTaskDatail = async ()=>{
+    const { error, code, data } = await taskApi.getDetail({ id: dataId.value })
     if (!error && code === 200) {
-        taskDetail.value=getObjValue(data)
-        tableData.value=data['planTaskInfoList']
-        taskBasicsInfo.value=data['basicsInfo']
-        otherInfo.value=data['otherInfo']||{}
-        let isFinancialPersonnel=data['basicsInfo'].isFinancialPersonnel
-        if(isFinancialPersonnel==1){//1 是财务审核
-            authType.value=true
-        }else{
-            authType.value=false
+        taskDetail.value = getObjValue(data)
+        tableData.value = data['planTaskInfoList']
+        taskBasicsInfo.value = data['basicsInfo']
+        otherInfo.value = data['otherInfo'] || {}
+        let isFinancialPersonnel = data['basicsInfo'].isFinancialPersonnel
+        if (isFinancialPersonnel == 1) {//1 是财务审核
+            authType.value = true
+        } else {
+            authType.value = false
         }
     } else {
-        taskDetail.value={}
+        taskDetail.value = {}
     }
 }
 //部门
@@ -235,8 +245,8 @@ const departMent = ref([])
 
 //任务表格
 const tableColumn = [
-    {key: 'projectName', name: '所属项目'},
-    {key: 'taskDesc', name: '任务描述'}
+    { key: 'projectName', name: '所属项目' },
+    { key: 'taskDesc', name: '任务描述' },
 ]
 const tableData = ref([])
 
@@ -249,7 +259,7 @@ const formRules = {
     title: {
         required: true,
         trigger: 'blur',
-        message: "请输入节点名称"
+        message: '请输入节点名称',
     },
 }
 const formPay = ref('1')
@@ -265,30 +275,30 @@ const groundsModal = ref(false)
 
 //驳回表单
 const formGroundsRef = ref(null)
-const formGroundsModel = ref({rejectDesc: ''})
+const formGroundsModel = ref({ rejectDesc: '' })
 const formGroundsRules = {
     rejectDesc: {
         required: true,
         trigger: 'blur',
-        message: "请输入驳回理由"
+        message: '请输入驳回理由',
     },
 }
 
 //确认驳回
-const saveGroundsClick = async() => {
+const saveGroundsClick = async () => {
  
     const res = await formValidate(formGroundsRef.value)
-    if(res){
-        const {error, code, data} = await taskApi.rejectTask(
+    if (res) {
+        const { error, code, data } = await taskApi.rejectTask(
         {
             id: taskDetail.value.basicsInfo.taskId,
-            rejectDesc:formGroundsModel.value?.rejectDesc
-        }
+            rejectDesc:formGroundsModel.value?.rejectDesc,
+        },
         )
         if (!error && code === 200) {
             window?.$message.warning('驳回成功!')
             router.push({
-                name: 'home-task'
+                name: 'home-task',
             })
         }
         closeGroundsClick()
@@ -300,29 +310,29 @@ const saveGroundsClick = async() => {
 }
 
 //取消驳回
-const closeGroundsClick = async() => {
+const closeGroundsClick = async () => {
     groundsModal.value = false
     groundsLoading.value = false
-    console.log(formGroundsModel.value,'formGroundsModel');
-    console.log(taskDetail.value,'renwu');
+    console.log(formGroundsModel.value, 'formGroundsModel')
+    console.log(taskDetail.value, 'renwu')
 
 }
 
 //审核通过
-const doubleClick = async() => {
+const doubleClick = async () => {
  
-    console.log(formGroundsModel.value,'formGroundsModel');
-    console.log(taskDetail.value,'renwu');
-    const {error, code, data} = await taskApi.submitTask(
+    console.log(formGroundsModel.value, 'formGroundsModel')
+    console.log(taskDetail.value, 'renwu')
+    const { error, code, data } = await taskApi.submitTask(
         {
             id: taskDetail.value.basicsInfo.taskId,
-            payStatus:taskBasicsInfo.value?.payStatus
-        }
+            payStatus:taskBasicsInfo.value?.payStatus,
+        },
         )
     if (!error && code === 200) {
         window?.$message.success('审核通过!')
         router.push({
-            name: 'home-task'
+            name: 'home-task',
         })
     } 
 }