소스 검색

日志任务变色

duy 2 년 전
부모
커밋
883842e113
2개의 변경된 파일86개의 추가작업 그리고 74개의 파일을 삭제
  1. 85 73
      src/views/expense/invoice/index.vue
  2. 1 1
      src/views/task/logs/components/logs-content.vue

+ 85 - 73
src/views/expense/invoice/index.vue

@@ -3,83 +3,94 @@
         <template #header>
             <div class="w-72">
                 <el-select v-model="searchForm.projectId" block clearable placeholder="项目名称" size="large">
-                    <el-option v-for="item in projectType" :label="item.projectName" :value="item.projectId"/>
+                    <el-option v-for="item in projectType" :label="item.projectName" :value="item.projectId" />
                 </el-select>
             </div>
             <div class="ml-4">
-                <el-button type="primary" @click="searchClick" size="large">
-                    <HcIcon name="search-2"/>
+                <el-button type="primary" size="large" @click="searchClick">
+                    <HcIcon name="search-2" />
                     <span>搜索</span>
                 </el-button>
             </div>
             <div class="ml-2">
                 <el-button size="large" @click="resetClick">
-                    <HcIcon name="close-circle"/>
+                    <HcIcon name="close-circle" />
                     <span>重置</span>
                 </el-button>
             </div>
-          
         </template>
         <template #extra>
             <el-button size="large" type="warning" hc-btn @click="draftsClick">
-                <HcIcon name="draft"/>
-                <span>草稿箱{{draftNum > 0 ? `(${draftNum})` : ''}}</span>
+                <HcIcon name="draft" />
+                <span>草稿箱{{ draftNum > 0 ? `(${draftNum})` : '' }}</span>
             </el-button>
             <el-button size="large" type="primary" hc-btn @click="addRowClick">
-                <HcIcon name="add"/>
+                <HcIcon name="add" />
                 <span>开票审批</span>
             </el-button>
         </template>
 
         <HcTable :column="tableColumn" :datas="tableData" :loading="tableLoading">
-            <template #action="{row,index}">
-                <el-button size="small" type="success" @click="invoiceItemUpload(row)">上传</el-button>
-                <el-button size="small" type="primary" @click="invoiceItemPdf(row)">查看</el-button>
-                <el-button size="small" type="danger" @confirm="rowCancel(row)">删除</el-button>
+            <template #action="{ row, index }">
+                <el-button size="small" type="success" @click="invoiceItemUpload(row)">
+                    上传
+                </el-button>
+                <el-button size="small" type="primary" @click="invoiceItemPdf(row)">
+                    查看
+                </el-button>
+                <el-button size="small" type="danger" @click="rowCancel(row)">
+                    删除
+                </el-button>
             </template>
         </HcTable>
 
         <template #action>
-            <HcPages :pages="searchForm" @change="pageChange"/>
+            <HcPages :pages="searchForm" @change="pageChange" />
         </template>
 
-        <!--草稿箱-->
-        <HcDialog isToBody isTable bgColor="#ffffff" widths="62rem" :footer="false" :show="draftsModal"
-                  :title="draftNum > 0 ? `草稿箱(${draftNum})` : '草稿箱'" @close="draftsCloseClick"
+        <!-- 草稿箱 -->
+        <HcDialog
+            is-to-body is-table bg-color="#ffffff" widths="62rem" :footer="false" :show="draftsModal"
+            :title="draftNum > 0 ? `草稿箱(${draftNum})` : '草稿箱'" @close="draftsCloseClick"
         >
             <el-alert title="3个月内未更新的草稿将被自动删除" type="warning" show-icon />
             <div style="position: relative;height: calc(100% - 44px);">
-                <HcTable :isIndex="false" :column="tableDraftsColumn" :datas="tableDraftsData">
-                    <template #action="{row,index}">
-                        <el-button size="small" type="primary" @click="editDraftClick(row)">继续编辑</el-button>
-                        <el-button size="small" type="danger" @click="delDraftClick(row)">删除</el-button>
+                <HcTable :is-index="false" :column="tableDraftsColumn" :datas="tableDraftsData">
+                    <template #action="{ row, index }">
+                        <el-button size="small" type="primary" @click="editDraftClick(row)">
+                            继续编辑
+                        </el-button>
+                        <el-button size="small" type="danger" @click="delDraftClick(row)">
+                            删除
+                        </el-button>
                     </template>
                 </HcTable>
             </div>
         </HcDialog>
 
-        <!--上传控件-->
-        <HcUploadFile ref="HcUploadFileRef"
-                      :options="uploadFileOptions"
-                      :echoParams="uploadEchoParams"
-                      @success="HcUploadFileSuccess"
+        <!-- 上传控件 -->
+        <HcUploadFile
+            ref="HcUploadFileRef"
+            :options="uploadFileOptions"
+            :echo-params="uploadEchoParams"
+            @success="HcUploadFileSuccess"
         />
 
-        <!--发票PDF-->
-        <HcDialog isToBody isTable bgColor="#ffffff" widths="62rem" :footer="false" :show="pdfModal" title="发票PDF" @close="pdfCloseClick">
-            <HcPdf src="http://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20230504/911982ba85e66cfa58fb02d5a738bb2b.pdf"/>
+        <!-- 发票PDF -->
+        <HcDialog is-to-body is-table bg-color="#ffffff" widths="62rem" :footer="false" :show="pdfModal" title="发票PDF" @close="pdfCloseClick">
+            <HcPdf src="http://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20230504/911982ba85e66cfa58fb02d5a738bb2b.pdf" />
         </HcDialog>
     </HcCard>
 </template>
 
 <script setup>
-import {onActivated, ref} from "vue";
-import {useRouter} from 'vue-router'
-import mainApi from "~api/expense/invoice";
-import {getProjectList} from "~api/other";
-import {getArrValue} from "js-fast-way";
-import {delMessage} from "~uti/tools";
-import {getTokenHeader} from "~src/api/request/header";
+import { onActivated, ref } from 'vue'
+import { useRouter } from 'vue-router'
+import mainApi from '~api/expense/invoice'
+import { getProjectList } from '~api/other'
+import { getArrValue } from 'js-fast-way'
+import { delMessage } from '~uti/tools'
+import { getTokenHeader } from '~src/api/request/header'
 
 const router = useRouter()
 
@@ -96,7 +107,7 @@ const getApi = () => {
 //项目类型
 const projectType = ref([])
 const getProjectData = async () => {
-    const {error, code, data} = await getProjectList()
+    const { error, code, data } = await getProjectList()
     //判断状态
     if (!error && code === 200) {
         projectType.value = getArrValue(data)
@@ -106,21 +117,21 @@ const getProjectData = async () => {
 }
 
 //搜索表单
-const searchForm = ref({projectId: null, current: 1, size: 20, total: 0})
+const searchForm = ref({ projectId: null, current: 1, size: 20, total: 0 })
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
+    searchForm.value.current = 1
     getTableData()
 }
 
 //重置搜索表单
 const resetClick = () => {
-    searchForm.value = {current: 1, size: 20, total: 0}
+    searchForm.value = { current: 1, size: 20, total: 0 }
 }
 
 //分页被点击
-const pageChange = ({current, size}) => {
+const pageChange = ({ current, size }) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -129,22 +140,22 @@ const pageChange = ({current, size}) => {
 //获取数据
 const tableLoading = ref(false)
 const tableColumn = [
-    {key: 'invoiceDate', name: '申请时间', width: '160'},
-    {key: 'projectName', name: '关联项目', minWidth: '220'},
-    {key: 'invoiceContentType', name: '开票内容', minWidth: '160'},
-    {key: 'invoiceMoney', name: '开票金额', width: '160', align: 'center'},
-    {key: 'invoiceTypeName', name: '发票类型', width: '160', align: 'center'},
-    {key: 'invoiceUserName', name: '开票人', width: '160', align: 'center'},
-    {key: 'approvalResultName', name: '审批结果', width: '160', align: 'center'},
-    {key: 'approvalStatusName', name: '审批状态', width: '140', align: 'center'},
-    {key: 'createName', name: '创建人', width: '140', align: 'center'},
-    {key: 'createTime', name: '创建时间', width: '160', align: 'center'},
-    {key: 'action', name: '操作', width: '220', align: 'center', fixed: 'right'},
+    { key: 'invoiceDate', name: '申请时间', width: '160' },
+    { key: 'projectName', name: '关联项目', minWidth: '220' },
+    { key: 'invoiceContentType', name: '开票内容', minWidth: '160' },
+    { key: 'invoiceMoney', name: '开票金额', width: '160', align: 'center' },
+    { key: 'invoiceTypeName', name: '发票类型', width: '160', align: 'center' },
+    { key: 'invoiceUserName', name: '开票人', width: '160', align: 'center' },
+    { key: 'approvalResultName', name: '审批结果', width: '160', align: 'center' },
+    { key: 'approvalStatusName', name: '审批状态', width: '140', align: 'center' },
+    { key: 'createName', name: '创建人', width: '140', align: 'center' },
+    { key: 'createTime', name: '创建时间', width: '160', align: 'center' },
+    { key: 'action', name: '操作', width: '220', align: 'center', fixed: 'right' },
 ]
 const tableData = ref([])
 const getTableData = async () => {
     tableLoading.value = true
-    const {error, code, data} = await mainApi.page(searchForm.value)
+    const { error, code, data } = await mainApi.page(searchForm.value)
     //判断状态
     tableLoading.value = false
     if (!error && code === 200) {
@@ -159,7 +170,7 @@ const getTableData = async () => {
 //新增预算
 const addRowClick = () => {
     router.push({
-        name: 'expense-invoice-billing'
+        name: 'expense-invoice-billing',
     })
 }
 
@@ -172,18 +183,18 @@ const uploadFileOptions = {
 }
 
 //电子发票
-const invoiceItemUpload = ({id}) => {
-    uploadEchoParams.value = {rowId: id}
-    HcUploadFileRef.value?.selectFile();
+const invoiceItemUpload = ({ id }) => {
+    uploadEchoParams.value = { rowId: id }
+    HcUploadFileRef.value?.selectFile()
 }
 
 //上传完成
-const HcUploadFileSuccess = async ({echoParams, resData}) => {
-    const {rowId} = echoParams, {pdfUrl} = resData
+const HcUploadFileSuccess = async ({ echoParams, resData }) => {
+    const { rowId } = echoParams, { pdfUrl } = resData
     if (rowId && pdfUrl) {
-        const {error, code, msg} = await mainApi.upload({
+        const { error, code, msg } = await mainApi.upload({
             id: rowId,
-            pdfUrl: pdfUrl
+            pdfUrl: pdfUrl,
         })
         //判断状态
         if (!error && code === 200) {
@@ -201,8 +212,8 @@ const HcUploadFileSuccess = async ({echoParams, resData}) => {
 const pdfModal = ref(false)
 const invoicePdfUrl = ref('')
 const invoiceItemPdf = async (row) => {
-    const {error, code, data, msg} = await mainApi.pdf({
-        id: row.id
+    const { error, code, data, msg } = await mainApi.pdf({
+        id: row.id,
     })
     //判断状态
     if (!error && code === 200) {
@@ -223,9 +234,10 @@ const pdfCloseClick = () => {
 
 //删除
 const rowCancel = (row) => {
+    console.log('删除')
     delMessage(async () => {
-        const {error, code, msg} = await mainApi.cancel({
-            id: row.id
+        const { error, code, msg } = await mainApi.cancel({
+            id: row.id,
         })
         //判断状态
         if (!error && code === 200) {
@@ -251,15 +263,15 @@ const draftsCloseClick = () => {
 //草稿箱数据
 const draftNum = ref(0)
 const tableDraftsColumn = [
-    {key: 'title', name: '标题'},
-    {key: 'updateTime', name: '更新时间', width: '200'},
-    {key: 'action', name: '操作', width: '170', align: 'center'},
+    { key: 'title', name: '标题' },
+    { key: 'updateTime', name: '更新时间', width: '200' },
+    { key: 'action', name: '操作', width: '170', align: 'center' },
 ]
 const tableDraftsData = ref([])
 
 //获取草稿数量
 const getDraftNum = async () => {
-    const {error, code, data} = await mainApi.draft()
+    const { error, code, data } = await mainApi.draft()
     //判断状态
     if (!error && code === 200) {
         const res = getArrValue(data)
@@ -272,19 +284,19 @@ const getDraftNum = async () => {
 }
 
 //继续编辑
-const editDraftClick = ({id}) => {
+const editDraftClick = ({ id }) => {
     draftsModal.value = false
     router.push({
         name: 'expense-invoice-billing',
-        query: {id: id}
+        query: { id: id },
     })
 }
 
 //删除草稿
-const delDraftClick = ({id}) => {
+const delDraftClick = ({ id }) => {
     delMessage(async () => {
-        const {error, code, msg} = await mainApi.remove({
-            id: id
+        const { error, code, msg } = await mainApi.remove({
+            id: id,
         })
         //判断状态
         if (!error && code === 200) {

+ 1 - 1
src/views/task/logs/components/logs-content.vue

@@ -137,7 +137,7 @@ const taskColumn = [
 
 //表格行样式
 const tableRowStyle = ({ row }) => {
-    if (row.statusName === '未完成') {
+    if (row.isOverdue === 1) {
         return {
             '--el-fill-color-lighter': 'rgba(189, 49, 36, 0.79)',
             '--el-table-row-hover-bg-color': 'var(--el-fill-color-lighter)',