chenrui
5 天以前 274894a41f857dac30877a5dee1c711a2a8049b6
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,7 +101,9 @@
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([
  {
@@ -213,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
  })
@@ -299,9 +304,19 @@
    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>
</style>