|
@@ -34,7 +34,7 @@
|
|
|
<el-option
|
|
|
v-for="item in constructorOptions"
|
|
|
:key="item.ID"
|
|
|
- :label="item.name"
|
|
|
+ :label="item.nickName"
|
|
|
:value="item.ID"
|
|
|
/>
|
|
|
</el-select>
|
|
@@ -53,9 +53,6 @@
|
|
|
</el-button>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item @click="openConstructor = true">
|
|
|
- 施工人员
|
|
|
- </el-dropdown-item>
|
|
|
<el-dropdown-item @click="listSwitching(1)">
|
|
|
详情列表
|
|
|
</el-dropdown-item>
|
|
@@ -75,7 +72,7 @@
|
|
|
label="项目编号"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="constructor.name"
|
|
|
+ prop="constructor.nickName"
|
|
|
label="姓名"
|
|
|
/>
|
|
|
<el-table-column
|
|
@@ -127,97 +124,6 @@
|
|
|
@size-change="handleSizeChange"
|
|
|
/>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- v-model="openConstructor"
|
|
|
- title="施工人员"
|
|
|
- width="800"
|
|
|
- align-center
|
|
|
- >
|
|
|
- <el-collapse v-model="activeNames">
|
|
|
- <el-collapse-item
|
|
|
- title="操作"
|
|
|
- name="1"
|
|
|
- >
|
|
|
- <el-form>
|
|
|
- <el-form-item label="施工人员">
|
|
|
- <el-input
|
|
|
- v-model="constructorData.name"
|
|
|
- style="width: 400px"
|
|
|
- >
|
|
|
- <template #prepend>
|
|
|
- <el-select
|
|
|
- v-model="constructorData.id"
|
|
|
- placeholder="查询"
|
|
|
- style="width: 115px"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- @change="changeConstructor"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in constructorOptions"
|
|
|
- :key="item.ID"
|
|
|
- :label="item.name"
|
|
|
- :value="item.ID"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- <template #append>
|
|
|
- <el-button @click="erasureConstructor">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="人天单价">
|
|
|
- <el-input
|
|
|
- v-model="constructorData.onePrice"
|
|
|
- style="width: 400px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button @click="saveConstructor">保存</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-collapse-item>
|
|
|
- <el-collapse-item
|
|
|
- title="列表"
|
|
|
- name="2"
|
|
|
- >
|
|
|
- <div>
|
|
|
- <el-table :data="constructorTableData">
|
|
|
- <el-table-column
|
|
|
- prop="name"
|
|
|
- label="姓名"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="onePrice"
|
|
|
- label="人天单价"
|
|
|
- />
|
|
|
- </el-table>
|
|
|
- <div class="gva-pagination">
|
|
|
- <el-pagination
|
|
|
- :current-page="searchData.pageInfo.page"
|
|
|
- :page-size="searchData.pageInfo.pageSize"
|
|
|
- :page-sizes="[10, 30, 50, 100]"
|
|
|
- :total="total"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-collapse-item>
|
|
|
- </el-collapse>
|
|
|
- <template #footer>
|
|
|
- <div class="dialog-footer">
|
|
|
- <el-button @click="openConstructor = false">取消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="openConstructor = false"
|
|
|
- >
|
|
|
- 确定
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
<!-- 修改-->
|
|
|
<el-dialog
|
|
|
v-model="workingDialog"
|
|
@@ -235,7 +141,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="人员">
|
|
|
<el-input
|
|
|
- v-model="workingHoursData.constructor.name"
|
|
|
+ v-model="workingHoursData.constructor.nickName"
|
|
|
disabled
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -266,25 +172,16 @@
|
|
|
<script setup>
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
import {
|
|
|
- createConstructor,
|
|
|
- deleteConstructor, deleteWorkingHours,
|
|
|
- queryConstructor,
|
|
|
+ deleteWorkingHours,
|
|
|
queryConstructorList, queryWorkingHoursList, queryWorkingHoursSum,
|
|
|
- updateConstructor, updateWorkingHours
|
|
|
+ updateWorkingHours
|
|
|
} from '@/api/finance'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import { getAllUsers } from '@/api/user'
|
|
|
|
|
|
// 施工人员----------------------------------------------------------------
|
|
|
|
|
|
-const activeNames = ref(['1'])
|
|
|
-const openConstructor = ref(false)
|
|
|
-
|
|
|
const constructorOptions = ref()
|
|
|
-const constructorData = ref({
|
|
|
- id: null,
|
|
|
- name: '',
|
|
|
- onePrice: null,
|
|
|
-})
|
|
|
|
|
|
const searchData = ref({
|
|
|
pageInfo: {
|
|
@@ -327,7 +224,7 @@ const workingHoursList = ref()
|
|
|
const workingHoursSum = ref()
|
|
|
|
|
|
const queryData = async() => {
|
|
|
- await queryConstructor().then(res => {
|
|
|
+ await getAllUsers().then(res => {
|
|
|
constructorOptions.value = res.data
|
|
|
})
|
|
|
await queryConstructorList(searchData.value).then(res => {
|
|
@@ -367,69 +264,6 @@ const listSwitching = async(val) => {
|
|
|
isOpen.value = val
|
|
|
}
|
|
|
|
|
|
-const changeConstructor = (val) => {
|
|
|
- for (const key in constructorOptions.value) {
|
|
|
- if (constructorOptions.value[key].ID === val) {
|
|
|
- constructorData.value.name = constructorOptions.value[key].name
|
|
|
- constructorData.value.onePrice = constructorOptions.value[key].onePrice
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 保存
|
|
|
-const saveConstructor = async() => {
|
|
|
- if (constructorData.value.name === '' || constructorData.value.onePrice === null) {
|
|
|
- ElMessage.error('数据不能为空')
|
|
|
- return false
|
|
|
- }
|
|
|
- if (constructorData.value.id === null || constructorData.value.id === undefined) {
|
|
|
- await createConstructor(constructorData.value).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- ElMessage.success('新增成功')
|
|
|
- }
|
|
|
- queryData()
|
|
|
- })
|
|
|
- } else {
|
|
|
- await updateConstructor(constructorData.value).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- ElMessage.success('修改成功')
|
|
|
- }
|
|
|
- queryData()
|
|
|
- })
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 删除
|
|
|
-const erasureConstructor = async() => {
|
|
|
- if (constructorData.value.id === null) {
|
|
|
- ElMessage.error('请选择人员')
|
|
|
- return false
|
|
|
- }
|
|
|
- ElMessageBox.confirm(
|
|
|
- '确定进行删除操作吗?',
|
|
|
- '删除',
|
|
|
- {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- }
|
|
|
- )
|
|
|
- .then(async() => {
|
|
|
- await deleteConstructor(constructorData.value).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- ElMessage.success('删除成功')
|
|
|
- }
|
|
|
- queryData()
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- ElMessage({
|
|
|
- type: 'info',
|
|
|
- message: '取消删除',
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
// 工时
|
|
|
const workingDialog = ref(false)
|
|
|
const workingHoursData = ref()
|