|
@@ -3,66 +3,77 @@
|
|
|
<template #header>
|
|
|
<div class="w-36">
|
|
|
<el-select v-model="searchForm.purType" block clearable placeholder="采购类型" size="large">
|
|
|
- <el-option v-for="item in purTypeData" :label="item.dictName" :value="item.dictValue"/>
|
|
|
+ <el-option v-for="item in purTypeData" :label="item.dictName" :value="item.dictValue" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="w-72 ml-2">
|
|
|
- <el-select v-model="searchForm.useOrgName" block clearable placeholder="使用单位" size="large">
|
|
|
+ <!-- <el-select v-model="searchForm.useOrgName" block clearable placeholder="使用单位" size="large">
|
|
|
<el-option label="暂无接口1" value="1"/>
|
|
|
<el-option label="暂无接口2" value="2"/>
|
|
|
+ </el-select> -->
|
|
|
+ <el-select v-model="searchForm.useOrgName" block clearable placeholder="采购类型" size="large">
|
|
|
+ <el-option v-for="item in useOrgNameData" :label="item.dictName" :value="item.dictValue" />
|
|
|
</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}">
|
|
|
+ <template #action="{ row, index }">
|
|
|
<el-popconfirm title="是否确认撤销?" hide-icon @confirm="rowCancel(row)">
|
|
|
<template #reference>
|
|
|
- <el-button size="small" type="primary"
|
|
|
- :disabled="row.status !== 1"
|
|
|
- :loading="row.isCancelLoading"
|
|
|
- >撤销</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small" type="primary"
|
|
|
+ :disabled="row.status !== 1"
|
|
|
+ :loading="row.isCancelLoading"
|
|
|
+ >
|
|
|
+ 撤销
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
</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>
|
|
@@ -71,12 +82,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {onActivated, ref} from "vue";
|
|
|
-import {useRouter} from 'vue-router'
|
|
|
-import {getDictInfo} from "~api/other";
|
|
|
-import mainApi from "~api/expense/purchaseRequest";
|
|
|
-import {getArrValue} from "js-fast-way";
|
|
|
-import {delMessage} from "~uti/tools";
|
|
|
+import { onActivated, ref } from 'vue'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+import { getDictInfo } from '~api/other'
|
|
|
+import mainApi from '~api/expense/purchaseRequest'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
+import { delMessage } from '~uti/tools'
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
@@ -86,6 +97,7 @@ onActivated(() => {
|
|
|
|
|
|
const getApi = () => {
|
|
|
getPurType()
|
|
|
+ getUseOrgNameData()
|
|
|
getTableData()
|
|
|
getDraftNum()
|
|
|
}
|
|
@@ -93,7 +105,7 @@ const getApi = () => {
|
|
|
//采购类型字典
|
|
|
const purTypeData = ref([])
|
|
|
const getPurType = async () => {
|
|
|
- const {error, code, data} = await getDictInfo('purchase_type')
|
|
|
+ const { error, code, data } = await getDictInfo('purchase_type')
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
|
purTypeData.value = getArrValue(data)
|
|
@@ -101,23 +113,33 @@ const getPurType = async () => {
|
|
|
purTypeData.value = []
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+//采购使用单位
|
|
|
+const useOrgNameData = ref([])
|
|
|
+const getUseOrgNameData = async () => {
|
|
|
+ const { error, code, data } = await mainApi.getUseOrgNameList()
|
|
|
+ //判断状态
|
|
|
+ if (!error && code === 200) {
|
|
|
+ useOrgNameData.value = getArrValue(data)
|
|
|
+ } else {
|
|
|
+ useOrgNameData.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
//搜索表单
|
|
|
-const searchForm = ref({purType: null, useOrgName: null, current: 1, size: 20, total: 0})
|
|
|
+const searchForm = ref({ purType: null, useOrgName: 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()
|
|
@@ -126,21 +148,21 @@ const pageChange = ({current, size}) => {
|
|
|
//获取数据
|
|
|
const tableLoading = ref(false)
|
|
|
const tableColumn = [
|
|
|
- {key: 'purDesc', name: '申请事由', minWidth: '200'},
|
|
|
- {key: 'purTypeName', name: '采购类型', width: '200', align: 'center'},
|
|
|
- {key: 'useOrgName', name: '使用单位', minWidth: '200'},
|
|
|
- {key: 'expectedDeliveryDate', name: '期望交付日期', width: '160', align: 'center'},
|
|
|
- {key: 'purPrice', name: '总采购资金', width: '160', align: 'center'},
|
|
|
- {key: 'approvalResultName', name: '审批结果', width: '140', align: 'center'},
|
|
|
- {key: 'approvalStatusName', name: '审批状态', width: '160', align: 'center'},
|
|
|
- {key: 'createName', name: '创建人', width: '140', align: 'center'},
|
|
|
- {key: 'createTime', name: '创建时间', width: '160', align: 'center'},
|
|
|
- {key: 'action', name: '操作', width: '90', align: 'center', fixed: 'right'},
|
|
|
+ { key: 'purDesc', name: '申请事由', minWidth: '200' },
|
|
|
+ { key: 'purTypeName', name: '采购类型', width: '200', align: 'center' },
|
|
|
+ { key: 'useOrgName', name: '使用单位', minWidth: '200' },
|
|
|
+ { key: 'expectedDeliveryDate', name: '期望交付日期', width: '160', align: 'center' },
|
|
|
+ { key: 'purPrice', name: '总采购资金', width: '160', align: 'center' },
|
|
|
+ { key: 'approvalResultName', name: '审批结果', width: '140', align: 'center' },
|
|
|
+ { key: 'approvalStatusName', name: '审批状态', width: '160', align: 'center' },
|
|
|
+ { key: 'createName', name: '创建人', width: '140', align: 'center' },
|
|
|
+ { key: 'createTime', name: '创建时间', width: '160', align: 'center' },
|
|
|
+ { key: 'action', name: '操作', width: '90', 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) {
|
|
@@ -155,7 +177,7 @@ const getTableData = async () => {
|
|
|
//撤销
|
|
|
const rowCancel = async (row) => {
|
|
|
row.isCancelLoading = true
|
|
|
- const {error, code, msg} = await mainApi.cancel({id: row.id})
|
|
|
+ const { error, code, msg } = await mainApi.cancel({ id: row.id })
|
|
|
//判断状态
|
|
|
row.isCancelLoading = false
|
|
|
if (!error && code === 200) {
|
|
@@ -170,7 +192,7 @@ const rowCancel = async (row) => {
|
|
|
//新增
|
|
|
const addRowClick = () => {
|
|
|
router.push({
|
|
|
- name: 'expense-purchaseRequest-record'
|
|
|
+ name: 'expense-purchaseRequest-record',
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -186,14 +208,14 @@ 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)
|
|
@@ -206,18 +228,18 @@ const getDraftNum = async () => {
|
|
|
}
|
|
|
|
|
|
//继续编辑
|
|
|
-const editDraftClick = ({emdraftIds}) => {
|
|
|
+const editDraftClick = ({ emdraftIds }) => {
|
|
|
draftsModal.value = false
|
|
|
router.push({
|
|
|
name: 'expense-purchaseRequest-record',
|
|
|
- query: {id: emdraftIds}
|
|
|
+ query: { id: emdraftIds },
|
|
|
})
|
|
|
}
|
|
|
|
|
|
//删除草稿
|
|
|
-const delDraftClick = ({groupId}) => {
|
|
|
+const delDraftClick = ({ groupId }) => {
|
|
|
delMessage(async () => {
|
|
|
- const {error, code, msg} = await mainApi.remove({groupId})
|
|
|
+ const { error, code, msg } = await mainApi.remove({ groupId })
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
|
window.$message?.success(msg)
|