123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <template>
- <HcCard>
- <template #header>
- <div class="w-36">
- <el-select v-model="searchForm.projectType" block clearable placeholder="项目类型" size="large">
- <el-option v-for="item in projectType" :label="item.name" :value="item.key"/>
- </el-select>
- </div>
- <div class="w-40 ml-2">
- <el-select v-model="searchForm.projectType" block clearable placeholder="服务类型" size="large">
- <el-option v-for="item in projectType" :label="item.name" :value="item.key"/>
- </el-select>
- </div>
- <div class="w-48 ml-2">
- <el-input v-model="searchForm.queryValue" clearable placeholder="请输入项目名称进行查询" size="large"/>
- </div>
- <div class="ml-4">
- <el-button type="primary" @click="searchClick" size="large">
- <HcIcon name="search-2"/>
- <span>搜索</span>
- </el-button>
- </div>
- <div class="ml-2">
- <el-button size="large" @click="resetClick">
- <HcIcon name="close-circle"/>
- <span>重置</span>
- </el-button>
- </div>
- </template>
- <template #extra>
- <el-button size="large" type="primary" hc-btn @click="updateClick">
- <HcIcon name="refresh"/>
- <span>合同回款更新</span>
- </el-button>
- <el-button size="large" type="primary" hc-btn @click="addRowClick">
- <HcIcon name="add"/>
- <span>新增项目合同信息</span>
- </el-button>
- </template>
- <HcTable :isIndex="false" :column="tableColumn" :datas="tableData" :loading="tableLoading">
- <template #key1="{row}">
- <span class="text-blue" @click="rowNameTap(row)">{{row.key1}}</span>
- </template>
- <template #action="{row,index}">
- <el-button plain size="small" type="primary" @click="editRowClick(row)">编辑</el-button>
- <el-button plain size="small" type="danger">删除</el-button>
- </template>
- </HcTable>
- <template #action>
- <HcPages :pages="searchForm" @change="pageChange"/>
- </template>
- </HcCard>
- </template>
- <script setup>
- import {ref} from "vue";
- import {useRouter} from 'vue-router'
- const router = useRouter()
- //项目类型
- const projectType = ref([
- {name: '二级路', key: '二级路'},
- {name: '国道', key: '国道'},
- {name: '水利水电', key: '水利水电'},
- {name: '市政', key: '市政'},
- ])
- //搜索表单
- const searchForm = ref({
- projectType: null, user: null, project: null,
- current: 1, size: 20, total: 0
- })
- //搜索
- const searchClick = () => {
- searchForm.value.current = 1;
- getTableData()
- }
- //重置搜索表单
- const resetClick = () => {
- searchForm.value = {current: 1, size: 20, total: 0}
- }
- //分页被点击
- const pageChange = ({current, size}) => {
- searchForm.value.current = current
- searchForm.value.size = size
- getTableData()
- }
- //获取数据
- const tableLoading = ref(false)
- const tableColumn = [
- {key: 'key', name: '合同编号', width: '120', align: 'center'},
- {key: 'key1', name: '合同名称'},
- {key: 'key2', name: '合同类型', width: '140', align: 'center'},
- {key: 'key3', name: '签订时间', width: '160', align: 'center'},
- {key: 'key4', name: '合同起止日期', width: '220', align: 'center'},
- {key: 'key5', name: '合同已履约回款', width: '140', align: 'center'},
- {key: 'key6', name: '合同未履约回款', width: '140', align: 'center'},
- {key: 'action', name: '操作', width: '130', align: 'center'},
- ]
- const tableData = ref([
- {id: 1, key: 'YS-01', key1: 'xxxx', key2: 'xxxx', key3: '65632', key4: '35654', key5: '12312', key6: 'xxxx'},
- {id: 2, key: 'YS-01', key1: 'xxxx', key2: 'xxxx', key3: '65632', key4: '35654', key5: '12312', key6: 'xxxx'},
- {id: 3, key: 'YS-01', key1: 'xxxx', key2: 'xxxx', key3: '65632', key4: '35654', key5: '12312', key6: 'xxxx'},
- {id: 4, key: 'YS-01', key1: 'xxxx', key2: 'xxxx', key3: '65632', key4: '35654', key5: '12312', key6: 'xxxx'},
- {id: 5, key: 'YS-01', key1: 'xxxx', key2: 'xxxx', key3: '65632', key4: '35654', key5: '12312', key6: 'xxxx'},
- {id: 6, key: 'YS-01', key1: 'xxxx', key2: 'xxxx', key3: '65632', key4: '35654', key5: '12312', key6: 'xxxx'},
- ])
- const getTableData = () => {
- }
- //预览
- const rowNameTap = (row) => {
- router.push({
- name: 'project-contract-form',
- query: {
- id: row.id,
- type: 'view'
- }
- })
- }
- //新增预算
- const addRowClick = () => {
- router.push({
- name: 'project-contract-form',
- query: {type: 'edit'}
- })
- }
- //编辑预算
- const editRowClick = (row) => {
- router.push({
- name: 'project-contract-form',
- query: {
- id: row.id,
- type: 'edit'
- }
- })
- }
- //合同回款更新
- const updateClick = () => {
- router.push({
- name: 'project-contract-update'
- })
- }
- </script>
|