From 274894a41f857dac30877a5dee1c711a2a8049b6 Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期四, 29 五月 2025 10:38:57 +0800 Subject: [PATCH] 自动填充功能修改 --- src/views/basicData/customerFile/index.vue | 33 ++++++++++++++++++++++++++------- 1 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue index 1a2b476..01f5e84 100644 --- a/src/views/basicData/customerFile/index.vue +++ b/src/views/basicData/customerFile/index.vue @@ -20,7 +20,7 @@ </div> </div> <div class="table_list"> - <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :handleSelectionChange="handleSelectionChange" + <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true" :handleSelectionChange="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination" :total="total"></PIMTable> </div> <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '鏂板瀹㈡埛淇℃伅' : '缂栬緫瀹㈡埛淇℃伅'" width="70%" @close="closeDia"> @@ -64,13 +64,13 @@ <el-row :gutter="30"> <el-col :span="12"> <el-form-item label="缁存姢浜猴細" prop="maintainer"> - <el-select v-model="form.maintainer" placeholder="璇烽�夋嫨" clearable> + <el-select v-model="form.maintainer" placeholder="璇烽�夋嫨" clearable disabled> <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> </el-select> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="缁存姢鏃堕棿锛�" prop="maintenanceTime"> + <el-form-item label="缁存姢鏃堕棿锛�" prop="maintenanceTime" > <el-date-picker style="width: 100%" v-model="form.maintenanceTime" @@ -79,6 +79,7 @@ type="date" placeholder="璇烽�夋嫨" clearable + disabled /> </el-form-item> </el-col> @@ -100,12 +101,14 @@ import {addCustomer, delCustomer, getCustomer, listCustomer, updateCustomer} from "@/api/basicData/customerFile.js"; import {ElMessageBox } from "element-plus"; import {userListNoPage} from "@/api/system/user.js"; +import useUserStore from "@/store/modules/user" const { proxy } = getCurrentInstance() +const userStore = useUserStore() const tableColumn = ref([ { label: '瀹㈡埛鍚嶇О', - prop: 'customerName' + prop: 'customerName', }, { label: '绾崇◣浜鸿瘑鍒爜', @@ -134,6 +137,7 @@ { dataType: "action", label: "鎿嶄綔", + align: 'center', operation: [ { name: "缂栬緫", @@ -212,6 +216,8 @@ const openForm = (type, row) => { operationType.value = type form.value = {} + form.value.maintainer = userStore.nickName + form.value.maintenanceTime = getCurrentDate(); userListNoPage().then(res => { userList.value = res.data }) @@ -281,23 +287,36 @@ } ElMessageBox.confirm( '閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�', - '瀵煎嚭', { + '鍒犻櫎鎻愮ず', { confirmButtonText: '纭', cancelButtonText: '鍙栨秷', type: 'warning', } ).then(() => { + tableLoading.value = true delCustomer(ids).then(res => { proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛") + getList() + }).finally(() => { + tableLoading.value = false }) - getList() }).catch(() => { proxy.$modal.msg("宸插彇娑�") }) } + +// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD +function getCurrentDate() { + const today = new Date(); + const year = today.getFullYear(); + const month = String(today.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮� + const day = String(today.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; +} + getList() </script> <style scoped lang="scss"> -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3