123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <div class="layout_display_flex_y">
- <div class="obviousBox" style="margin-bottom: 6px;">
- <searchArea :searchData="searchData" @submit="searchByForm"></searchArea>
- </div>
- <div class="layout_display_flex_y" style="height: 85%">
- <div style="background-color: #fff;padding: 8px">
- <el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增</el-button>
- </div>
- <el-table
- :data="tableData"
- border style="width: 100%" height="100%" stripe highlight-current-row class="ypClassTable normal-size">
- <el-table-column prop="code" label="项目编码">
- </el-table-column>
- <el-table-column prop="name" label="项目名称">
- </el-table-column>
- <el-table-column prop="name" label="规格">
- </el-table-column>
- <el-table-column prop="name" label="单位">
- </el-table-column>
- <el-table-column prop="name" label="物价码">
- </el-table-column>
- <el-table-column prop="delFlag" label="项目类型">
- </el-table-column>
- <el-table-column prop="delFlag" label="是否停用">
- </el-table-column>
- <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
- <template #default="scope">
- <el-button type="primary" size="small" @click="editYpClass(scope.row)">编辑</el-button>
- <el-button :type="scope.row.delFlag !== '0' ? 'success' : 'info'" size="small"
- @click.prevent="changeDelFlag(scope.row)">
- {{ scope.row.delFlag == '0' ? '停用' : '启用' }}
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div>
- <el-pagination :current-page="pageNumber" :page-size="pageSize" :page-sizes="[10, 15, 20, 25]"
- :total="total" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
- @size-change="handleSizeChange" @current-change="handleCurrentChange">
- </el-pagination>
- </div>
- </div>
- <el-dialog v-model="showDialog" :close-on-click-modal="false" :close-on-press-escape="false"
- :title="(currentEditCode ? '编辑' : '新增') + '项目'" width="100%" destroy-on-close fullscreen @close="handleDialogClose">
- <!-- <YpPrintName :ypPrintNameDetail="ypPrintNameDetail" @closeYpPrintNameEditFor="closeYpPrintName" /> -->
- <info :currentEditCode="currentEditCode" @handleDialogClose="handleDialogClose"></info>
- </el-dialog>
- </template>
- <script setup name="YpDict">
- import { ref, onMounted, nextTick } from 'vue'
- import { ElMessage, ElMessageBox } from 'element-plus'
- import { getLcProjectList, insertLcProject } from '@/api/lc/project.js'
- import searchArea from '@/components/searchArea/index.vue';
- import info from '@/views/logisticsMaterials/logisticsBasicData/projectInformation/info.vue';
- const delFlagOption = [{ value: '0', label: '启用' }, { value: '1', label: '停用' }]
- const searchData = ref([
- {
- label: '项目编码',
- key: 'vehicleName',
- type: 'input',
- value: '',
- clearable: true,
- },
- {
- label: '项目名称',
- key: 'vehicleType',
- type: 'select',
- value: '',
- optionsData: [ //(0:轿车,1:面包车,2:越野车,3:吉普车,4:巴士,5:卡车)
- {
- label: '轿车',
- value: '0',
- },
- {
- label: '面包车',
- value: '1',
- },
- ],
- },
- {
- label: '项目类型',
- key: 'vehicleType',
- type: 'select',
- value: '',
- optionsData: [
- {
- label: '轿车',
- value: '0',
- },
- {
- label: '面包车',
- value: '1',
- },
- ],
- },
- {
- label: '是否停用',
- key: 'vehicleType',
- type: 'select',
- value: '',
- optionsData: [
- {
- label: '否',
- value: '0',
- },
- {
- label: '是',
- value: '1',
- },
- ],
- },
- ])
- const pageSize = ref(10)
- const pageNumber = ref(1)
- const total = ref(0)
- const currentEditCode = ref('')
- const tableData = ref([])
- const handleSizeChange = (val) => {
- pageSize.value = val
- }
- const handleCurrentChange = (val) => {
- pageNumber.value = val
- }
- let showDialog = ref(false)
- onMounted(() => {
- nextTick(() => {
-
- })
- })
- //搜索表单方法
- const searchByForm = (form) => {
- console.log("search", form)
- }
- // 新增行
- const onAddItem = () => {
- showDialog.value = true
- }
- const handleDialogClose = () => {
- currentEditCode.value = ""
- showDialog.value = false
- }
- </script>
- <style lang="scss" deep>
- .el-dialog__body {
- // padding: 0 16px;
- // height: calc(100% - 25px);
- }
- .el-tabs {
- height: calc(100% - 27px);
- .el-tabs__content {
- padding: 5px;
- height: calc(100% - 27px);
- }
- .el-tab-pane {
- height: calc(100% - 27px);
- overflow: auto;
- }
- .el-table__inner-wrapper {
- height: calc(100% - 10px) !important;
- }
- }
- .el-table .warning-row {
- --el-table-tr-bg-color: #dd7694;
- }
- .search-select-pre {
- padding: 0 12px;
- color: var(--el-text-color-regular);
- background: var(--el-fill-color-light);
- border-right: 1px solid var(--el-border-color);
- --el-select-input-padding-left: '0'
- }
- </style>
|