瀏覽代碼

完善 工时 新增 日常费用1

xuwenhao 8 月之前
父節點
當前提交
bde26bb53e

+ 2 - 2
server/config.yaml

@@ -125,8 +125,8 @@ mysql:
     config: charset=utf8mb4&parseTime=True&loc=Local
     db-name: lc_finance
     username: root
-    password: lczm*2019
-    path: 106.52.134.22
+    password: root
+    path: 127.0.0.1
     engine: ""
     log-mode: error
     max-idle-conns: 10

+ 2 - 2
server/dao/borrowing.go

@@ -12,7 +12,7 @@ type Borrowing struct {
 	ApplicationTime string          `json:"applicationTime" form:"applicationTime" gorm:"comment:申请日期"`
 	Charge          int             `json:"charge" form:"charge" gorm:"comment:负责人"`
 	User            SysUser         `json:"user" form:"user" gorm:"foreignKey:Charge;references:id;"`
-	Price           decimal.Decimal `json:"price" form:"price" gorm:"comment:支借金额"`
+	Price           decimal.Decimal `json:"price" form:"price" gorm:"comment:支借金额;type:decimal(10,2)"`
 }
 
 func (Borrowing) TableName() string {
@@ -24,7 +24,7 @@ func (Borrowing) TableName() string {
 // QueryBorrowingList 查询支借列表
 func QueryBorrowingList(limit, offset int, name, time string) (borrowing []Borrowing, total int64, err error) {
 	// 创建db
-	db := global.GVA_DB.Model(&DailyExpenses{})
+	db := global.GVA_DB.Model(&Borrowing{})
 	// 如果有条件搜索 下方会自动创建搜索语句
 	if name != "" {
 		db = db.Where("name LIKE ?", "%"+name+"%")

+ 12 - 1
server/service/admin/project.go

@@ -104,7 +104,18 @@ func (ps *ProjectService) QueryCollectionList(info request.SearchProjectList) (l
 func (ps *ProjectService) QueryReimbursementList(info request.SearchProjectList) (list interface{}, total int64, err error) {
 	limit := info.PageInfo.PageSize
 	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
-	return dao.QueryReimbursementList(limit, offset, info.Code, info.Name, info.Time)
+	reimbursements, total, err := dao.QueryReimbursementList(limit, offset, info.Code, info.Name, info.Time)
+	if err != nil {
+		return nil, 0, err
+	}
+	for i, reimbursement := range reimbursements {
+		details, err := dao.QueryFeeDetails(int(reimbursement.ID))
+		if err != nil {
+			return nil, 0, err
+		}
+		reimbursements[i].FeeDetails = details
+	}
+	return
 }
 
 func (ps *ProjectService) QueryReimbursement(code string) ([]dao.Reimbursement, error) {

+ 72 - 0
web/src/api/finance.js

@@ -31,6 +31,29 @@ export const queryWorkingHoursSum = (data) => {
   })
 }
 
+export const queryExpensesGenre = () => {
+  return service({
+    url: '/finance/queryExpensesGenre',
+    method: 'get'
+  })
+}
+
+export const queryDailyExpensesList = (data) => {
+  return service({
+    url: '/finance/queryDailyExpensesList',
+    method: 'post',
+    data
+  })
+}
+
+export const queryBorrowingList = (data) => {
+  return service({
+    url: '/finance/queryBorrowingList',
+    method: 'post',
+    data
+  })
+}
+
 export const createConstructor = (data) => {
   return service({
     url: '/constructor/createConstructor',
@@ -39,6 +62,22 @@ export const createConstructor = (data) => {
   })
 }
 
+export const createDailyExpenses = (data) => {
+  return service({
+    url: '/finance/createDailyExpenses',
+    method: 'post',
+    data
+  })
+}
+
+export const createBorrowing = (data) => {
+  return service({
+    url: '/finance/createBorrowing',
+    method: 'post',
+    data
+  })
+}
+
 export const updateConstructor = (data) => {
   return service({
     url: '/constructor/updateConstructor',
@@ -46,6 +85,23 @@ export const updateConstructor = (data) => {
     data
   })
 }
+
+export const updateDailyExpenses = (data) => {
+  return service({
+    url: '/finance/updateDailyExpenses',
+    method: 'put',
+    data
+  })
+}
+
+export const updateBorrowing = (data) => {
+  return service({
+    url: '/finance/updateBorrowing',
+    method: 'put',
+    data
+  })
+}
+
 export const deleteConstructor = (data) => {
   return service({
     url: '/constructor/deleteConstructor',
@@ -53,3 +109,19 @@ export const deleteConstructor = (data) => {
     data
   })
 }
+
+export const deleteDailyExpenses = (data) => {
+  return service({
+    url: '/finance/deleteDailyExpenses',
+    method: 'delete',
+    data
+  })
+}
+
+export const deleteBorrowing = (data) => {
+  return service({
+    url: '/finance/deleteBorrowing',
+    method: 'delete',
+    data
+  })
+}

+ 617 - 68
web/src/view/finance/borrowing/borrowing.vue

@@ -1,79 +1,514 @@
 <template>
-  <div>
-    <el-table
-      v-loading="loading"
-      :data="tableData"
-      row-key="id"
+  <div class="gva-table-box">
+    <el-tabs
+      v-model="activeName"
+      class="demo-tabs"
     >
-      <el-table-column
-        property="id"
-        label="序号"
-      />
-      <el-table-column
-        property="name"
-        label="姓名"
+      <el-tab-pane
+        label="报销"
+        name="first"
       >
-        <template #default="scope">
-          <el-input
-            v-if="!scope.row.id"
-            v-model="scope.row.name"
-          />
-          <span v-else> {{ scope.row.name }} </span>
-        </template>
-      </el-table-column>
-      <el-table-column
-        property="number"
-        label="年龄"
+        <el-header>
+          <el-row>
+            <el-col :span="20">
+              <el-form inline>
+                <el-form-item label="名称">
+                  <el-input v-model="searchDailyExpenses.name" />
+                </el-form-item>
+                <el-form-item label="时间">
+                  <el-date-picker
+                    v-model="searchDailyExpenses.time"
+                    type="date"
+                    placeholder="选择日期"
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
+                  />
+                </el-form-item>
+                <el-form-item label="类型">
+                  <el-select
+                    v-model.number="searchDailyExpenses.state"
+                    placeholder="查询"
+                    style="width: 115px"
+                    clearable
+                    filterable
+                  >
+                    <el-option
+                      v-for="item in feeGenre"
+                      :key="item.ID"
+                      :label="item.name"
+                      :value="item.ID"
+                    />
+                  </el-select>
+                </el-form-item>
+                <el-form-item>
+                  <el-button
+                    type="primary"
+                    @click="queryData"
+                  >查询</el-button>
+                </el-form-item>
+              </el-form>
+            </el-col>
+            <el-col :span="4">
+              <el-button @click="dailyExpensesOpen">新增记录</el-button>
+            </el-col>
+          </el-row>
+        </el-header>
+        <el-main>
+          <el-table :data="dailyExpensesTable">
+            <el-table-column
+              prop="name"
+              label="名称"
+            >
+              <template #default="scope">
+                <el-button
+                  type="primary"
+                  link
+                  @click="expensesDetailsData(scope.row)"
+                >{{ scope.row.name }}</el-button>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="expensesGenre.name"
+              label="费用类型"
+            />
+            <el-table-column
+              prop="applicant"
+              label="申请人"
+            />
+            <el-table-column
+              prop="user.nickName"
+              label="负责人"
+            />
+            <el-table-column
+              prop="totalAmount"
+              label="报销总金额"
+            />
+            <el-table-column
+              prop="applicationTime"
+              label="申请日期"
+            />
+          </el-table>
+          <div class="gva-pagination">
+            <el-pagination
+              :current-page="searchDailyExpenses.pageInfo.page"
+              :page-size="searchDailyExpenses.pageInfo.pageSize"
+              :page-sizes="[10, 30, 50, 100]"
+              :total="dailyExpensesTotal"
+              layout="total, sizes, prev, pager, next, jumper"
+              @current-change="dailyExpensesCurrentChange"
+              @size-change="dailyExpensesSizeChange"
+            />
+          </div>
+          <!--           新增-->
+          <el-drawer
+            v-model="openDailyExpenses"
+            title="报销记录"
+            direction="rtl"
+            size="50%"
+          >
+            <el-form
+              label-width="auto"
+              style="max-width: 900px"
+            >
+              <el-form-item label="名称">
+                <el-input
+                  v-model="dailyExpensesData.name"
+                  style="width: 300px"
+                />
+              </el-form-item>
+              <el-form-item label="费用类型">
+                <el-select v-model="dailyExpensesData.genre">
+                  <el-option
+                    v-for="item in feeGenre"
+                    :key="item.ID"
+                    :label="item.name"
+                    :value="item.ID"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="申请人">
+                <el-input
+                  v-model="dailyExpensesData.applicant"
+                  style="width: 300px"
+                />
+              </el-form-item>
+              <el-form-item label="申请时间">
+                <el-date-picker
+                  v-model="dailyExpensesData.applicationTime"
+                  type="date"
+                  placeholder="选择日期"
+                  value-format="YYYY-MM-DD"
+                />
+              </el-form-item>
+              <el-form-item label="负责人">
+                <el-select v-model="dailyExpensesData.charge">
+                  <el-option
+                    v-for="item in users"
+                    :key="item.ID"
+                    :label="item.nickName"
+                    :value="item.ID"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="总金额">
+                <el-input-number
+                  v-model="dailyExpensesData.totalAmount"
+                  style="width: 300px"
+                  :precision="2"
+                  disabled
+                />
+              </el-form-item>
+              <el-form-item>
+                <el-table
+                  :data="dailyExpensesData.dailyFeeDetails"
+                  row-key="id"
+                >
+                  <el-table-column
+                    label="序号"
+                    property="id"
+                    prop="id"
+                  />
+                  <el-table-column
+                    property="illustrate"
+                    label="费用说明"
+                  >
+                    <template #default="scope">
+                      <el-input
+                        v-model="scope.row.illustrate"
+                        type="textarea"
+                        maxlength="100"
+                        show-word-limit
+                      />
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    property="price"
+                    label="报销金额"
+                  >
+                    <template #default="scope">
+                      <el-input-number
+                        v-model.number="scope.row.price"
+                        :precision="2"
+                        :min="0"
+                        @change="sumExpenses"
+                      />
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    property="feeTime"
+                    label="日期"
+                  >
+                    <template #default="scope">
+                      <el-date-picker
+                        v-model="scope.row.feeTime"
+                        type="date"
+                        placeholder="选择日期"
+                        value-format="YYYY-MM-DD"
+                      />
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="操作"
+                  >
+                    <template #default="scope">
+                      <el-button
+                        @click="handleDelete(scope.row.id)"
+                      >删除</el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </el-form-item>
+              <el-form-item>
+                <el-button
+                  type="success"
+                  @click="addLineData"
+                >添加一行</el-button>
+              </el-form-item>
+            </el-form>
+            <template #footer>
+              <div style="flex: auto">
+                <el-button
+                  type="warning"
+                  @click="erasureDailyExpenses"
+                >删除</el-button>
+                <el-button @click="openDailyExpenses = false">取消</el-button>
+                <el-button
+                  type="primary"
+                  @click="saveDailyExpenses"
+                >保存</el-button>
+              </div>
+            </template>
+          </el-drawer>
+        </el-main>
+      </el-tab-pane>
+      <el-tab-pane
+        label="支借"
+        name="second"
       >
-        <template #default="scope">
-          <el-input
-            v-if="!scope.row.id"
-            v-model="scope.row.number"
-          />
-          <span v-else> {{ scope.row.number }} </span>
-        </template>
-      </el-table-column>
-      <el-table-column
-        label="操作"
-        fixed="right"
-        align="center"
-        width="200"
-      >
-        <template #default="scope">
-          <el-button
-            v-if="!scope.row.id"
-            type="primary"
-            size="small"
-            @click.stop="handleSave(scope.row)"
-          >保存</el-button>
-          <el-button
-            v-if="!scope.row.id"
-            type="primary"
-            size="small"
-            @click.stop="handleDelete(scope.row)"
-          >删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div>
-      <el-button
-        type="success"
-        @click="addLineData"
-      >添加一行</el-button>
-    </div>
+        <el-header>
+          <el-row>
+            <el-col :span="20">
+              <el-form inline>
+                <el-form-item label="名称">
+                  <el-input v-model="searchBorrowing.name" />
+                </el-form-item>
+                <el-form-item label="时间">
+                  <el-date-picker
+                    v-model="searchBorrowing.time"
+                    type="date"
+                    placeholder="选择日期"
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
+                  />
+                </el-form-item>
+                <el-form-item>
+                  <el-button
+                    type="primary"
+                    @click="queryData"
+                  >查询</el-button>
+                </el-form-item>
+              </el-form>
+            </el-col>
+            <el-col :span="4" />
+          </el-row>
+        </el-header>
+        <el-main>
+          <el-table :data="borrowingTable">
+            <el-table-column
+              prop="name"
+              label="名称"
+            >
+              <template #default="scope">
+                <el-button
+                  type="primary"
+                  link
+                  @click="openBorrowing(scope.row)"
+                >{{ scope.row.name }}</el-button>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="applicant"
+              label="申请人"
+            />
+            <el-table-column
+              prop="user.nickName"
+              label="负责人"
+            />
+            <el-table-column
+              prop="price"
+              label="支借金额"
+            />
+            <el-table-column
+              prop="applicationTime"
+              label="申请日期"
+            />
+          </el-table>
+          <div class="gva-pagination">
+            <el-pagination
+              :current-page="searchBorrowing.pageInfo.page"
+              :page-size="searchBorrowing.pageInfo.pageSize"
+              :page-sizes="[10, 30, 50, 100]"
+              :total="borrowingTotal"
+              layout="total, sizes, prev, pager, next, jumper"
+              @current-change="borrowingCurrentChange"
+              @size-change="borrowingSizeChange"
+            />
+          </div>
+          <el-dialog
+            v-model="borrowingDialog"
+            title="详情"
+            width="500"
+            align-center
+          >
+            <div>
+              <el-form>
+                <el-form-item label="名称">
+                  <el-input v-model="borrowingData.name" />
+                </el-form-item>
+                <el-form-item label="申请人">
+                  <el-input v-model="borrowingData.applicant" />
+                </el-form-item>
+                <el-form-item label="申请日期">
+                  <el-date-picker
+                    v-model="borrowingData.applicationTime"
+                    type="date"
+                    placeholder="选择日期"
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
+                  />
+                </el-form-item>
+                <el-form-item label="负责人">
+                  <el-select v-model="borrowingData.charge">
+                    <el-option
+                      v-for="item in users"
+                      :key="item.ID"
+                      :label="item.nickName"
+                      :value="item.ID"
+                    />
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="支借金额">
+                  <el-input-number
+                    v-model="borrowingData.price"
+                    :min="0.00"
+                    :precision="2"
+                  />
+                </el-form-item>
+              </el-form>
+            </div>
+            <template #footer>
+              <div class="dialog-footer">
+                <el-button
+                  type="warning"
+                  @click="borrowingDialog = false"
+                >删除</el-button>
+                <el-button @click="borrowingDialog = false">取消</el-button>
+                <el-button
+                  type="primary"
+                  @click="saveBorrowing"
+                >
+                  保存
+                </el-button>
+              </div>
+            </template>
+          </el-dialog>
+        </el-main>
+      </el-tab-pane>
+    </el-tabs>
   </div>
 </template>
 
 <script setup>
-import { ref } from 'vue'
-import { ElMessageBox } from 'element-plus'
-const tableData = ref([])
+import { onMounted, ref } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import {
+  createBorrowing,
+  createDailyExpenses,
+  deleteDailyExpenses, queryBorrowingList,
+  queryDailyExpensesList,
+  queryExpensesGenre, updateBorrowing,
+  updateDailyExpenses
+} from '@/api/finance'
+import { getAllUsers } from '@/api/user'
+
+// 数据初始化
+const feeGenre = ref()
+const users = ref()
+
+const dailyExpensesTable = ref()
+const dailyExpensesTotal = ref(0)
+const searchDailyExpenses = ref({
+  pageInfo: {
+    page: 1,
+    pageSize: 10
+  },
+  name: '',
+  time: '',
+  state: null
+})
+// 分页
+const dailyExpensesSizeChange = (val) => {
+  searchDailyExpenses.value.pageInfo.pageSize = val
+  queryData()
+}
+
+const dailyExpensesCurrentChange = (val) => {
+  searchDailyExpenses.value.pageInfo.page = val
+  queryData()
+}
+
+const borrowingTable = ref()
+const borrowingTotal = ref(0)
+const searchBorrowing = ref({
+  pageInfo: {
+    page: 1,
+    pageSize: 10
+  },
+  name: '',
+  time: ''
+})
+// 分页
+const borrowingSizeChange = (val) => {
+  searchBorrowing.value.pageInfo.pageSize = val
+  queryData()
+}
+
+const borrowingCurrentChange = (val) => {
+  searchBorrowing.value.pageInfo.page = val
+  queryData()
+}
+
+const queryData = async() => {
+  if (searchDailyExpenses.value.state === '') {
+    searchDailyExpenses.value.state = null
+  }
+  await queryExpensesGenre().then(res => {
+    feeGenre.value = res.data
+  })
+  await getAllUsers().then(res => {
+    users.value = res.data
+  })
+  await queryDailyExpensesList(searchDailyExpenses.value).then(res => {
+    dailyExpensesTable.value = res.data.list
+    searchDailyExpenses.value.pageInfo.page = res.data.page
+    searchDailyExpenses.value.pageInfo.pageSize = res.data.pageSize
+    dailyExpensesTotal.value = res.data.total
+  })
+  await queryBorrowingList(searchBorrowing.value).then(res => {
+    console.log(res)
+    borrowingTable.value = res.data.list
+    searchBorrowing.value.pageInfo.page = res.data.page
+    searchBorrowing.value.pageInfo.pageSize = res.data.pageSize
+    borrowingTotal.value = res.data.total
+  })
+}
+
+const activeName = ref('first')
+
+// 日常报销
+const openDailyExpenses = ref(false)
+
+const dailyExpensesOpen = () => {
+  dailyExpensesData.value = {
+    name: '',
+    genre: null,
+    applicant: '',
+    applicationTime: '',
+    charge: null,
+    totalAmount: 0,
+    dailyFeeDetails: [{
+      id: 1,
+      feeTime: '',
+      illustrate: '',
+      price: 0
+    }]
+  }
+  openDailyExpenses.value = true
+}
+
+const dailyExpensesData = ref({
+  name: '',
+  genre: null,
+  applicant: '',
+  applicationTime: '',
+  charge: null,
+  totalAmount: 0,
+  dailyFeeDetails: [{
+    id: 1,
+    feeTime: '',
+    illustrate: '',
+    price: 0
+  }]
+})
+
 const addLineData = () => {
   const newData = {
-    name: '',
-    number: '',
+    id: dailyExpensesData.value.dailyFeeDetails.length + 1,
+    feeTime: '',
+    illustrate: '',
+    price: 0
   }
-  tableData.value.push(newData)
+  dailyExpensesData.value.dailyFeeDetails.push(newData)
 }
 
 const handleDelete = (val) => {
@@ -82,13 +517,127 @@ const handleDelete = (val) => {
     cancelButtonText: '取消',
     type: 'warning',
   }).then(() => {
-    console.log(val)
+    const ds = dailyExpensesData.value.dailyFeeDetails.filter(item => item.id !== val)
+    for (let i = 0; i < ds.length; i++) {
+      ds[i].id = i + 1
+    }
+    dailyExpensesData.value.dailyFeeDetails = ds
   })
 }
 
-const handleSave = (val) => {
-  console.log(tableData.value)
+const sumExpenses = () => {
+  let sum = 0
+  for (const key in dailyExpensesData.value.dailyFeeDetails) {
+    sum += dailyExpensesData.value.dailyFeeDetails[key].price
+  }
+  dailyExpensesData.value.totalAmount = sum
+}
+
+// 保存
+const saveDailyExpenses = async() => {
+  for (let i = 0; i < dailyExpensesData.value.dailyFeeDetails.length; i++) {
+    dailyExpensesData.value.dailyFeeDetails[i].id = null
+  }
+  const dd = dailyExpensesData.value
+  // 校验
+  if (dd.name === '' || dd.genre == null || dd.charge == null || dd.applicationTime === '' || dd.applicant === '') {
+    ElMessage.error('请将数据填写完整')
+    return false
+  }
+  if (dd.ID === null) {
+    await createDailyExpenses(dd).then(res => {
+      if (res.code === 0) {
+        ElMessage.success('新增成功')
+        queryData()
+        openDailyExpenses.value = false
+      }
+    })
+  } else {
+    await updateDailyExpenses(dd).then(res => {
+      if (res.code === 0) {
+        ElMessage.success('修改成功')
+        queryData()
+        openDailyExpenses.value = false
+      }
+    })
+  }
 }
+
+// 详情
+const expensesDetailsData = (val) => {
+  console.log(val)
+  dailyExpensesData.value = val
+  openDailyExpenses.value = true
+}
+
+// 删除
+const erasureDailyExpenses = async() => {
+  for (let i = 0; i < dailyExpensesData.value.dailyFeeDetails.length; i++) {
+    dailyExpensesData.value.dailyFeeDetails[i].id = null
+  }
+  const dd = dailyExpensesData.value
+  ElMessageBox.confirm(
+    '确定进行删除操作吗?',
+    '删除',
+    {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning',
+    }
+  )
+    .then(async() => {
+      await deleteDailyExpenses(dd).then(res => {
+        console.log(res)
+        if (res.code === 0) {
+          ElMessage.success('删除成功')
+          queryData()
+          openDailyExpenses.value = false
+        }
+      })
+    })
+}
+
+// 支借
+const borrowingDialog = ref(false)
+
+const borrowingData = ref()
+
+const openBorrowing = (val) => {
+  console.log(val)
+  borrowingData.value = val
+  borrowingDialog.value = true
+}
+
+// 保存
+const saveBorrowing = async() => {
+  const dd = borrowingData.value
+  // 校验
+  if (dd.name === '' || dd.charge == null || dd.applicationTime === '' || dd.applicant === '') {
+    ElMessage.error('请将数据填写完整')
+    return false
+  }
+  if (dd.ID === null) {
+    await createBorrowing(dd).then(res => {
+      if (res.code === 0) {
+        ElMessage.success('新增成功')
+        queryData()
+        borrowingDialog.value = false
+      }
+    })
+  } else {
+    await updateBorrowing(dd).then(res => {
+      if (res.code === 0) {
+        ElMessage.success('修改成功')
+        queryData()
+        borrowingDialog.value = false
+      }
+    })
+  }
+}
+
+onMounted(() => {
+  queryData()
+})
 </script>
 
 <style scoped lang="scss">

+ 70 - 18
web/src/view/finance/workingHours/workingHours.vue

@@ -1,24 +1,71 @@
 <template>
   <el-container class="gva-table-box">
     <el-header>
-      <el-dropdown>
-        <el-button type="primary">
-          菜单<el-icon class="el-icon--right"><arrow-down /></el-icon>
-        </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>
-            <el-dropdown-item @click="listSwitching(2)">
-              总列表
-            </el-dropdown-item>
-          </el-dropdown-menu>
-        </template>
-      </el-dropdown>
+      <el-row>
+        <el-col :span="20">
+          <el-form inline>
+            <el-form-item label="项目编号">
+              <el-input v-model="searchWorkingHours.code" />
+            </el-form-item>
+            <el-form-item label="时间">
+              <el-date-picker
+                v-model="searchWorkingHours.time"
+                type="month"
+                placeholder="选择月份"
+                format="YYYY-MM"
+                value-format="YYYY-MM"
+              />
+              <el-date-picker
+                v-model="searchWorkingHours.yearTime"
+                type="year"
+                placeholder="选择年份"
+                format="YYYY"
+                value-format="YYYY"
+              />
+            </el-form-item>
+            <el-form-item label="人员">
+              <el-select
+                v-model.number="searchWorkingHours.people"
+                placeholder="查询"
+                style="width: 115px"
+                clearable
+                filterable
+              >
+                <el-option
+                  v-for="item in constructorOptions"
+                  :key="item.ID"
+                  :label="item.name"
+                  :value="item.ID"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button
+                type="primary"
+                @click="listSwitching(isOpen)"
+              >查询</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+        <el-col :span="4"><el-dropdown>
+          <el-button type="primary">
+            菜单<el-icon class="el-icon--right"><arrow-down /></el-icon>
+          </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>
+              <el-dropdown-item @click="listSwitching(2)">
+                总列表
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </template>
+        </el-dropdown></el-col>
+      </el-row>
     </el-header>
     <el-main>
       <div v-if="isOpen === 1">
@@ -217,6 +264,7 @@ const searchWorkingHours = ref({
   },
   code: '',
   time: '',
+  yearTime: '',
   people: null,
 })
 
@@ -248,6 +296,10 @@ const isOpen = ref(1)
 
 // 列表切换
 const listSwitching = async(val) => {
+  if (searchWorkingHours.value.people === '') {
+    searchWorkingHours.value.people = null
+  }
+  console.log(searchWorkingHours.value)
   if (val === 1) {
     await queryData()
   } else if (val === 2) {