| | |
| | | v-hasPermi="['cwgl:smartLockerApplication:export']">导出 |
| | | </el-button> --> |
| | | </template> |
| | | |
| | | |
| | | <template #itemName-form="{ row, size, }"> |
| | | <div style="cursor: pointer;"> |
| | | <el-input v-if="itemTypeIShow" v-model="form.itemName" placeholder="请输入 物品名称"> |
| | | </el-input> |
| | | <el-input v-if="!itemTypeIShow" v-model="form.itemName" @click="debouncedItemNameChange" |
| | | placeholder="请输入 车牌号"> |
| | | </el-input> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #menu="{ size, row, index }"> |
| | | <el-link class="link-btn" type="primary" :underline="false" plain :size="size" |
| | | @click="handleEditBtn(row, index)" v-if="row.status == 0" |
| | | v-hasPermi="['cwgl:smartLockerApplication:cancel']"> 编辑 |
| | | <el-link class="link-btn" type="primary" :underline="false" plain :size="size" |
| | | @click="handleEditBtn(row, index)" v-if="row.status == 0" v-hasPermi="['cwgl:smartLockerApplication:cancel']"> |
| | | 编辑 |
| | | </el-link> |
| | | <el-link class="link-btn" v-if="row.status == 0" type="primary" :underline="false" plain @click="handleInvalid(row)" |
| | | v-hasPermi="['cwgl:smartLockerApplication:invalid']"> 作废 |
| | | <el-link class="link-btn" v-if="row.status == 0" type="primary" :underline="false" plain |
| | | @click="handleInvalid(row)" v-hasPermi="['cwgl:smartLockerApplication:invalid']"> 作废 |
| | | </el-link> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </template> |
| | | |
| | | <script setup name="smartLockerApplication" lang="ts"> |
| | | import { SmartLockerApplicationI, addSmartLockerApplication, delSmartLockerApplication, exportSmartLockerApplication, getSmartLockerApplication, listSmartLockerApplication, updateSmartLockerApplication, smartLockerApplicationQuery, |
| | | import { |
| | | SmartLockerApplicationI, addSmartLockerApplication, delSmartLockerApplication, exportSmartLockerApplication, getSmartLockerApplication, listSmartLockerApplication, updateSmartLockerApplication, smartLockerApplicationQuery, |
| | | smartLockerApplicationInvalid |
| | | } from "@/api/cwgl/smartLockerApplication"; |
| | | } from "@/api/cwgl/smartLockerApplication"; |
| | | import useCurrentInstance from "@/utils/useCurrentInstance"; |
| | | import { computed, reactive, ref, toRefs } from "vue"; |
| | | import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface"; |
| | |
| | | currentPage: 1, |
| | | }, |
| | | selectionList: [], |
| | | itemTypeIShow: true, // 控制 itemType 显示隐藏 |
| | | itemTypeIcon: '物品名称不能为空', |
| | | }) |
| | | const { queryParams, form, page, selectionList } = toRefs(data); |
| | | const { queryParams, form, page, selectionList, itemTypeIShow, itemTypeIcon } = toRefs(data); |
| | | const option = ref({ |
| | | pageKey: 'SmartLockerApplication', |
| | | rowKey: 'id', |
| | |
| | | // editDisplay: false, // 修改时不显示 |
| | | dicUrl: '/system/dict/data/type/sys_item_type', |
| | | change: (val: any) => { |
| | | if (val.value === '0') { |
| | | itemTypeIShow.value = false; |
| | | itemTypeIcon.value = '车牌号不能为空' |
| | | } else { |
| | | itemTypeIShow.value = true; |
| | | itemTypeIcon.value = '物品名称不能为空' |
| | | |
| | | } |
| | | option.value.column.itemName.rules = [ |
| | | { |
| | | required: true, |
| | | message: itemTypeIcon.value, |
| | | trigger: "blur" |
| | | } |
| | | ]; |
| | | |
| | | // 清除之前的校验状态 |
| | | if (crudRef.value) { |
| | | crudRef.value.clearValidate('itemName'); |
| | | } |
| | | |
| | | if (val.value === '1') { |
| | | if (form.value.itemName !== '' && form.value.itemName !== undefined) { |
| | | |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "物品名称不能为空", trigger: "blur" |
| | | message: itemTypeIcon.value, trigger: "blur" |
| | | } |
| | | ], |
| | | change: (val: any) => { |
| | |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | addDisplay: true, // 新增时不显示 |
| | | minWidth: 200, |
| | | rules: [ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "领取截止时间不能为空", trigger: "change" |
| | |
| | | handleBeforeOpenFunc: (done: Function, type: string) => { |
| | | if (done == 'add') { |
| | | option.value.column.lockerNo.value = '接驳站智能钥匙柜' |
| | | option.value.column.deadlineTime.value =formatDateTime(new Date(Date.now() + 24 * 60 * 60 * 1000)); |
| | | |
| | | |
| | | option.value.column.deadlineTime.value = formatDateTime(new Date(Date.now() + 24 * 60 * 60 * 1000)); |
| | | |
| | | |
| | | } |
| | | }, |
| | | handleSelectionChangeFunc: (selection: any) => { |
| | |
| | | } |
| | | }) |
| | | |
| | | const formatDateTime = (date) => { |
| | | const formatDateTime = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | |
| | | if (form.value.itemType === '0' && val) { |
| | | // 在这里添加你的请求接口逻辑 |
| | | smartLockerApplicationQuery({ licensePlateNumber: val }).then(response => { |
| | | if(response.code == 200){ |
| | | form.value.lockerPort = response.data || ''; |
| | | if (response.code == 200) { |
| | | form.value.lockerPort = response.data || ''; |
| | | } |
| | | // 处理响应 |
| | | }) |