From d9b8d6c13f429a7b4be55ad00ac48a918ab4703b Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期三, 28 一月 2026 17:11:03 +0800
Subject: [PATCH] 新增申请开票代码
---
ui/admin-ui3/src/views/cwgl/smartLockerApplication/index.vue | 101 ++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 85 insertions(+), 16 deletions(-)
diff --git a/ui/admin-ui3/src/views/cwgl/smartLockerApplication/index.vue b/ui/admin-ui3/src/views/cwgl/smartLockerApplication/index.vue
index 3801c99..2c5a3a5 100644
--- a/ui/admin-ui3/src/views/cwgl/smartLockerApplication/index.vue
+++ b/ui/admin-ui3/src/views/cwgl/smartLockerApplication/index.vue
@@ -16,10 +16,25 @@
v-hasPermi="['cwgl:smartLockerApplication:export']">瀵煎嚭
</el-button> -->
</template>
- <template #menu="{ size, row, index }">
- <el-link class="link-btn" v-if="row.status == 0" type="primary" :underline="false" plain @click="handleInvalid(row)"
- v-hasPermi="['cwgl:smartLockerApplication:invalid']"> 浣滃簾
+
+ <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>
+ <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>
@@ -27,9 +42,10 @@
</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";
@@ -57,8 +73,10 @@
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',
@@ -119,6 +137,27 @@
// 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) {
@@ -134,7 +173,7 @@
rules: [
{
required: true,
- message: "鐗╁搧鍚嶇О涓嶈兘涓虹┖", trigger: "blur"
+ message: itemTypeIcon.value, trigger: "blur"
}
],
change: (val: any) => {
@@ -171,14 +210,28 @@
}
],
},
-
-
+ deadlineTime: {
+ label: '棰嗗彇鎴鏃堕棿',
+ minWidth: 180,
+ type: 'datetime', // 鏀逛负 datetime 绫诲瀷
+ format: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ addDisplay: true, // 鏂板鏃朵笉鏄剧ず
+ minWidth: 200,
+ rules: [
+ {
+ required: true,
+ message: "棰嗗彇鎴鏃堕棿涓嶈兘涓虹┖", trigger: "change"
+ }
+ ],
+ },
cancelTime: {
label: '浣滃簾鏃堕棿',
minWidth: 180,
type: 'datetime', // 鏀逛负 datetime 绫诲瀷
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ editDisplay: false,
addDisplay: false, // 鏂板鏃朵笉鏄剧ず
minWidth: 200,
@@ -188,6 +241,7 @@
minWidth: 180,
type: 'datetime', // 鏀逛负 datetime 绫诲瀷
format: 'YYYY-MM-DD HH:mm:ss',
+ editDisplay: false,
addDisplay: false, // 鏂板鏃朵笉鏄剧ず
valueFormat: 'YYYY-MM-DD HH:mm:ss',
@@ -197,7 +251,7 @@
label: '鍒涘缓鏃堕棿',
minWidth: 180,
addDisplay: false, // 鏂板鏃朵笉鏄剧ず
-
+ editDisplay: false,
type: 'datetime', // 鏀逛负 datetime 绫诲瀷
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
@@ -216,6 +270,7 @@
fixed: 'right',
dataType: 'string',
type: 'select',
+ editDisplay: false,
addDisplay: false, // 鏂板鏃朵笉鏄剧ず
dicUrl: '/system/dict/data/type/sys_apply_status',
},
@@ -257,6 +312,9 @@
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));
+
+
}
},
handleSelectionChangeFunc: (selection: any) => {
@@ -264,10 +322,18 @@
}
})
+const formatDateTime = (date) => {
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const day = String(date.getDate()).padStart(2, '0');
+ const hours = String(date.getHours()).padStart(2, '0');
+ const minutes = String(date.getMinutes()).padStart(2, '0');
+ const seconds = String(date.getSeconds()).padStart(2, '0');
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+};
// 鍦� script setup 閮ㄥ垎瀹氫箟闃叉姈鑺傛祦鍑芥暟
let debounceTimer: NodeJS.Timeout | null = null;
let throttleTimer: NodeJS.Timeout | null = null;
-
// 闃叉姈鍑芥暟
const debounce = (func: Function, delay: number) => {
return function (...args: any[]) {
@@ -295,11 +361,11 @@
// 瀹氫箟瀹為檯瑕佹墽琛岀殑鍑芥暟
const handleItemNameChange = (val: any) => {
// 鍒ゆ柇 itemType 鏄惁涓� '0'锛屽苟涓� itemName 鏈夊��
- if (form.value.itemType === '0' && val) {
+ if (form.value.itemType == 0 && val) {
// 鍦ㄨ繖閲屾坊鍔犱綘鐨勮姹傛帴鍙i�昏緫
smartLockerApplicationQuery({ licensePlateNumber: val }).then(response => {
- if(response.code == 200){
- form.value.lockerPort = response.data || '';
+ if (response.code == 200) {
+ form.value.lockerPort = response.data || '';
}
// 澶勭悊鍝嶅簲
})
@@ -311,11 +377,14 @@
const handleInvalid = (row: any) => {
proxy.$modal.confirm(`鏄惁浣滃簾璇ョ敵棰嗕汉缂栫爜 锛�${row.applicantCode}?`).then(function () {
return smartLockerApplicationInvalid(row.id);
- }).then((res) => {
+ }).then((res:any) => {
onLoad(page.value);
proxy.$modal.msgSuccess(res.msg);
})
}
-
+const handleEditBtn = (row:any, index:any) => {
+ crudRef.value.rowEdit(row, index)
+ // option.value.editBtn = true;
+}
</script>
--
Gitblit v1.8.0