This commit is contained in:
		
							parent
							
								
									9e15ac71a9
								
							
						
					
					
						commit
						276341dadc
					
				| 
						 | 
				
			
			@ -0,0 +1,86 @@
 | 
			
		|||
export  interface  ComplaintsAndEvaluations{
 | 
			
		||||
  userAccount?:string,
 | 
			
		||||
  phone?:string | number,
 | 
			
		||||
  content?:string,
 | 
			
		||||
  title?:string,
 | 
			
		||||
  complaintTypes?:string,
 | 
			
		||||
  uploadVoucher?:string,
 | 
			
		||||
  stateProcessing?:string,
 | 
			
		||||
  commitTime?:string,
 | 
			
		||||
  associatedWindow?:string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const complaintsAndEvaluationsData:ComplaintsAndEvaluations[] = [
 | 
			
		||||
  {
 | 
			
		||||
    userAccount:'1452466452',
 | 
			
		||||
    phone:'13575462541',
 | 
			
		||||
    content:'辣椒炒肉没有肉,只有辣椒,并且菜品里面还有头发丝',
 | 
			
		||||
    title:'卫生投诉',
 | 
			
		||||
    complaintTypes:'卫生不达标',
 | 
			
		||||
    uploadVoucher:'',
 | 
			
		||||
    stateProcessing:'未处理',
 | 
			
		||||
    commitTime:'2025-5-16 14:12:21',
 | 
			
		||||
    associatedWindow:'3号窗口'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    userAccount:'145485685',
 | 
			
		||||
    phone:'13575462551',
 | 
			
		||||
    content:'碗筷消毒没有消干净,还留有残渣',
 | 
			
		||||
    title:'卫生投诉',
 | 
			
		||||
    complaintTypes:'卫生不达标',
 | 
			
		||||
    uploadVoucher:'',
 | 
			
		||||
    stateProcessing:'未处理',
 | 
			
		||||
    commitTime:'2025-5-16 14:12:21',
 | 
			
		||||
    associatedWindow:'4号窗口'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export interface evaluationType{
 | 
			
		||||
  evaluationId?:string,
 | 
			
		||||
  content?:string,
 | 
			
		||||
  auditStatus?:{
 | 
			
		||||
      value?:number,
 | 
			
		||||
      label?:string
 | 
			
		||||
  },
 | 
			
		||||
  anonymous?:string,
 | 
			
		||||
  comprehensiveScore?:string,
 | 
			
		||||
  image?:string,
 | 
			
		||||
  associatedWindowEvaluation?:string,
 | 
			
		||||
  commitTimeEvaluation?:string,
 | 
			
		||||
  author?:string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const evaluationTypeData:evaluationType[] = [
 | 
			
		||||
  {
 | 
			
		||||
    evaluationId:'123152313',
 | 
			
		||||
    author:'青青子衿',
 | 
			
		||||
    content:'菜品味道不错,但排队时间太长',
 | 
			
		||||
    auditStatus:{
 | 
			
		||||
       value:1,
 | 
			
		||||
       label:'已公开'
 | 
			
		||||
    },
 | 
			
		||||
    anonymous:'否',
 | 
			
		||||
    comprehensiveScore:'4星',
 | 
			
		||||
    image:'',
 | 
			
		||||
    associatedWindowEvaluation:'一号窗口',
 | 
			
		||||
    commitTimeEvaluation:'2025-5-16 14:52:10'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    evaluationId:'123152313',
 | 
			
		||||
    author:'悠悠我心',
 | 
			
		||||
    content:'菜品味道不错,色香味俱全,卫生也是相当干净,点赞',
 | 
			
		||||
    auditStatus:{
 | 
			
		||||
      value:0,
 | 
			
		||||
      label:'待审核'
 | 
			
		||||
    },
 | 
			
		||||
    anonymous:'否',
 | 
			
		||||
    comprehensiveScore:'5星',
 | 
			
		||||
    image:'',
 | 
			
		||||
    associatedWindowEvaluation:'二号窗口',
 | 
			
		||||
    commitTimeEvaluation:'2025-5-16 14:52:10'
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
]
 | 
			
		||||
export  default {complaintsAndEvaluationsData,evaluationTypeData}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,288 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <div>投诉与评价</div>
 | 
			
		||||
  <div>
 | 
			
		||||
    <n-card style="margin-bottom:16px">
 | 
			
		||||
      <n-tabs type="line" animated>
 | 
			
		||||
        <n-tab-pane name="用户反馈" tab="用户反馈">
 | 
			
		||||
          <TablePro
 | 
			
		||||
            ref="tableRef"
 | 
			
		||||
            :request-api="reqApi"
 | 
			
		||||
            :search-form-options="complaintsAndEvaluations"
 | 
			
		||||
            :columns="columns"
 | 
			
		||||
            :isPageTable="true"
 | 
			
		||||
            :single-line="false"
 | 
			
		||||
          >
 | 
			
		||||
            <template #headerExtra>
 | 
			
		||||
              <n-button style="margin-left: 10px">一键导出</n-button>
 | 
			
		||||
            </template>
 | 
			
		||||
          </TablePro>
 | 
			
		||||
        </n-tab-pane>
 | 
			
		||||
        <n-tab-pane name="评价" tab="评价">
 | 
			
		||||
          <TablePro
 | 
			
		||||
            ref="tableRef"
 | 
			
		||||
            :request-api="reqApiEvaluation"
 | 
			
		||||
            :search-form-options="complaintsAndEvaluationsEvaluation"
 | 
			
		||||
            :columns="columnsEvaluation"
 | 
			
		||||
            :isPageTable="true"
 | 
			
		||||
            :single-line="false"
 | 
			
		||||
          >
 | 
			
		||||
            <template #headerExtra>
 | 
			
		||||
              <n-button style="margin-left: 10px">一键导出</n-button>
 | 
			
		||||
            </template>
 | 
			
		||||
          </TablePro>
 | 
			
		||||
        </n-tab-pane>
 | 
			
		||||
      </n-tabs>
 | 
			
		||||
    </n-card>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script setup></script>
 | 
			
		||||
<script setup lang="tsx">
 | 
			
		||||
  import { TablePro, type TableProProps } from "@/components";
 | 
			
		||||
  import { type FormInst, NPerformantEllipsis, NPopconfirm, NTag, useModal } from "naive-ui";
 | 
			
		||||
  import { reactive, ref } from "vue";
 | 
			
		||||
  import { type ComplaintsAndEvaluations, type evaluationType } from "@/views/ComplaintsAndEvaluations/index.ts";
 | 
			
		||||
  import andEvaluations from "@/views/ComplaintsAndEvaluations/index.ts";
 | 
			
		||||
 | 
			
		||||
  type TableType = TableProProps<any, any>;
 | 
			
		||||
 | 
			
		||||
  // 投诉
 | 
			
		||||
  const reqApi: TableType["requestApi"] = (params) => {
 | 
			
		||||
    return new Promise((resolve) => {
 | 
			
		||||
      resolve({
 | 
			
		||||
        code: 200,
 | 
			
		||||
        data: {
 | 
			
		||||
          current: "1",
 | 
			
		||||
          // @ts-ignore
 | 
			
		||||
          pages: "2",
 | 
			
		||||
          records: andEvaluations.complaintsAndEvaluationsData,
 | 
			
		||||
          size: "10",
 | 
			
		||||
          total: "12"
 | 
			
		||||
        },
 | 
			
		||||
        message: "操作成功!"
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  const complaintsAndEvaluations = reactive<TableType["searchFormOptions"]>({
 | 
			
		||||
    time: {
 | 
			
		||||
      type: "datePicker",
 | 
			
		||||
      label: "时间"
 | 
			
		||||
    },
 | 
			
		||||
    userName: {
 | 
			
		||||
      type: "input",
 | 
			
		||||
      label: "用户账号"
 | 
			
		||||
    },
 | 
			
		||||
    complaintTypes: {
 | 
			
		||||
      type: "select",
 | 
			
		||||
      label: "投诉类型",
 | 
			
		||||
      options: [
 | 
			
		||||
        {
 | 
			
		||||
          value: "",
 | 
			
		||||
          label: ""
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const columns = ref<TableType["columns"]>([
 | 
			
		||||
    {
 | 
			
		||||
      key: "userAccount",
 | 
			
		||||
      title: "用户账号"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "uploadVoucher",
 | 
			
		||||
      title: "上传凭证"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "phone",
 | 
			
		||||
      title: "联系方式"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "content",
 | 
			
		||||
      title: "内容"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "associatedWindow",
 | 
			
		||||
      title: "关联窗口/档口"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "title",
 | 
			
		||||
      title: "标题"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "complaintTypes",
 | 
			
		||||
      title: "投诉类型"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "stateProcessing",
 | 
			
		||||
      title: "处理状态",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-tag type="error">{value.stateProcessing}</n-tag>
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "commitTime",
 | 
			
		||||
      title: "提交时间"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "",
 | 
			
		||||
      title: "操作",
 | 
			
		||||
      render: (value: ComplaintsAndEvaluations) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <div style={{ display: "flex" }}>
 | 
			
		||||
            <n-button
 | 
			
		||||
              strong
 | 
			
		||||
              secondary
 | 
			
		||||
              type="primary"
 | 
			
		||||
            >
 | 
			
		||||
              审核通过
 | 
			
		||||
            </n-button>
 | 
			
		||||
            <NPopconfirm
 | 
			
		||||
              onPositiveClick={async () => {
 | 
			
		||||
              }}
 | 
			
		||||
              onNegativeClick={() => {
 | 
			
		||||
              }}
 | 
			
		||||
              showIcon={false}
 | 
			
		||||
            >
 | 
			
		||||
              {{
 | 
			
		||||
                trigger: () => (
 | 
			
		||||
                  <n-button
 | 
			
		||||
                    strong
 | 
			
		||||
                    secondary
 | 
			
		||||
                    style={{ marginLeft: "10px" }}
 | 
			
		||||
                    type="error"
 | 
			
		||||
                  >
 | 
			
		||||
                    删除
 | 
			
		||||
                  </n-button>
 | 
			
		||||
                ),
 | 
			
		||||
                default: () => "确认要除么?"
 | 
			
		||||
              }}
 | 
			
		||||
            </NPopconfirm>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ]);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  //评价
 | 
			
		||||
  const reqApiEvaluation: TableType["requestApi"] = (params) => {
 | 
			
		||||
    return new Promise((resolve) => {
 | 
			
		||||
      resolve({
 | 
			
		||||
        code: 200,
 | 
			
		||||
        data: {
 | 
			
		||||
          current: "1",
 | 
			
		||||
          // @ts-ignore
 | 
			
		||||
          pages: "2",
 | 
			
		||||
          records: andEvaluations.evaluationTypeData,
 | 
			
		||||
          size: "10",
 | 
			
		||||
          total: "12"
 | 
			
		||||
        },
 | 
			
		||||
        message: "操作成功!"
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
  const complaintsAndEvaluationsEvaluation = reactive<TableType["searchFormOptions"]>({
 | 
			
		||||
    time: {
 | 
			
		||||
      type: "datePicker",
 | 
			
		||||
      label: "时间"
 | 
			
		||||
    },
 | 
			
		||||
    auditStatus: {
 | 
			
		||||
      type: "select",
 | 
			
		||||
      label: "审核状态",
 | 
			
		||||
      options: [
 | 
			
		||||
        {
 | 
			
		||||
          value: 0,
 | 
			
		||||
          label: "待审核"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          value: 1,
 | 
			
		||||
          label: "已公开"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          value: 2,
 | 
			
		||||
          label: "已隐藏"
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const columnsEvaluation = ref<TableType["columns"]>([
 | 
			
		||||
    {
 | 
			
		||||
      key: "evaluationId",
 | 
			
		||||
      title: "评价ID"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "author",
 | 
			
		||||
      title: "提交人"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "auditStatus",
 | 
			
		||||
      title: "审核状态",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-tag
 | 
			
		||||
            type={value.auditStatus.value === 0 ? "warning" : value.auditStatus.value === 1 ? "success" : "info"}>{value.auditStatus.label}</n-tag>
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "anonymous",
 | 
			
		||||
      title: "是否匿名"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "comprehensiveScore",
 | 
			
		||||
      title: "综合评分"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "content",
 | 
			
		||||
      title: "评价内容"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "image",
 | 
			
		||||
      title: "图片"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "associatedWindowEvaluation",
 | 
			
		||||
      title: "关联窗口/档口"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "commitTimeEvaluation",
 | 
			
		||||
      title: "提交时间"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "",
 | 
			
		||||
      title: "操作",
 | 
			
		||||
      render: (value: evaluationType) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <div style={{ display: "flex" }}>
 | 
			
		||||
            <n-button strong secondary type="primary">审核通过</n-button>
 | 
			
		||||
            <n-button strong secondary type="warning" style={{ marginLeft: "10px" }}>隐藏</n-button>
 | 
			
		||||
            <NPopconfirm
 | 
			
		||||
              onPositiveClick={async () => {
 | 
			
		||||
              }}
 | 
			
		||||
              onNegativeClick={() => {
 | 
			
		||||
              }}
 | 
			
		||||
              showIcon={false}
 | 
			
		||||
            >
 | 
			
		||||
              {{
 | 
			
		||||
                trigger: () => (
 | 
			
		||||
                  <n-button
 | 
			
		||||
                    strong
 | 
			
		||||
                    secondary
 | 
			
		||||
                    style={{ marginLeft: "10px" }}
 | 
			
		||||
                    type="error"
 | 
			
		||||
                  >
 | 
			
		||||
                    删除
 | 
			
		||||
                  </n-button>
 | 
			
		||||
                ),
 | 
			
		||||
                default: () => "确认要除么?"
 | 
			
		||||
              }}
 | 
			
		||||
            </NPopconfirm>
 | 
			
		||||
          </div>
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ]);
 | 
			
		||||
</script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -254,7 +254,8 @@ export  interface  ElectronicScale {
 | 
			
		|||
  outOfRange?:string,
 | 
			
		||||
  unit?:string,
 | 
			
		||||
  deviceModel?:string,
 | 
			
		||||
  serialNumber?:string
 | 
			
		||||
  serialNumber?:string,
 | 
			
		||||
  image?:string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const dataListElectronicScale:ElectronicScale[] = [
 | 
			
		||||
| 
						 | 
				
			
			@ -268,7 +269,8 @@ const dataListElectronicScale:ElectronicScale[] = [
 | 
			
		|||
    outOfRange:'正常',
 | 
			
		||||
    deviceModel:'ES-2000',
 | 
			
		||||
    serialNumber:'SN123456789',
 | 
			
		||||
    weighingTime:'2025-5-10 14:15:20'
 | 
			
		||||
    weighingTime:'2025-5-10 14:15:20',
 | 
			
		||||
    image:'https://wx.wy2020.com/assets/common/images/404.png'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    personInCharge:'刘某',
 | 
			
		||||
| 
						 | 
				
			
			@ -280,7 +282,8 @@ const dataListElectronicScale:ElectronicScale[] = [
 | 
			
		|||
    outOfRange:'正常',
 | 
			
		||||
    deviceModel:'ES-2000',
 | 
			
		||||
    serialNumber:'SN123456789',
 | 
			
		||||
    weighingTime:'2025-5-10 14:15:20'
 | 
			
		||||
    weighingTime:'2025-5-10 14:15:20',
 | 
			
		||||
    image:'https://wx.wy2020.com/assets/common/images/404.png'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    personInCharge:'张某',
 | 
			
		||||
| 
						 | 
				
			
			@ -292,7 +295,8 @@ const dataListElectronicScale:ElectronicScale[] = [
 | 
			
		|||
    outOfRange:'正常',
 | 
			
		||||
    deviceModel:'ES-2000',
 | 
			
		||||
    serialNumber:'SN123456789',
 | 
			
		||||
    weighingTime:'2025-5-10 14:15:20'
 | 
			
		||||
    weighingTime:'2025-5-10 14:15:20',
 | 
			
		||||
    image:'https://wx.wy2020.com/assets/common/images/404.png'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    personInCharge:'李某',
 | 
			
		||||
| 
						 | 
				
			
			@ -304,7 +308,8 @@ const dataListElectronicScale:ElectronicScale[] = [
 | 
			
		|||
    outOfRange:'正常',
 | 
			
		||||
    deviceModel:'ES-2000',
 | 
			
		||||
    serialNumber:'SN123456789',
 | 
			
		||||
    weighingTime:'2025-5-10 14:15:20'
 | 
			
		||||
    weighingTime:'2025-5-10 14:15:20',
 | 
			
		||||
    image:'https://wx.wy2020.com/assets/common/images/404.png'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,9 +60,9 @@
 | 
			
		|||
    Icon
 | 
			
		||||
  } from "@/components";
 | 
			
		||||
  import { type FormInst, NPerformantEllipsis, NPopconfirm, NTag, useModal } from "naive-ui";
 | 
			
		||||
  import { type HardwareData,type ElectronicScale } from "@/views/hardwareData/index.ts";
 | 
			
		||||
  import { type HardwareData, type ElectronicScale } from "@/views/hardwareData/index.ts";
 | 
			
		||||
  import hardwareData from "@/views/hardwareData/index.ts";
 | 
			
		||||
  import { ref,reactive } from "vue";
 | 
			
		||||
  import { ref, reactive } from "vue";
 | 
			
		||||
 | 
			
		||||
  const tableRef = useTemplateRef<TableProInst>("tableRef");
 | 
			
		||||
  const modal = useModal();
 | 
			
		||||
| 
						 | 
				
			
			@ -87,25 +87,25 @@
 | 
			
		|||
  const searchFormOptions = reactive<TableType["searchFormOptions"]>({
 | 
			
		||||
    time: {
 | 
			
		||||
      type: "datePicker",
 | 
			
		||||
      label: "时间",
 | 
			
		||||
      label: "时间"
 | 
			
		||||
    },
 | 
			
		||||
    userName:{
 | 
			
		||||
      type:'input',
 | 
			
		||||
    userName: {
 | 
			
		||||
      type: "input",
 | 
			
		||||
      label: "员工姓名"
 | 
			
		||||
    },
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
  const columns = ref<TableType["columns"]>([
 | 
			
		||||
    {
 | 
			
		||||
      key:'userName',
 | 
			
		||||
      title:'员工姓名'
 | 
			
		||||
      key: "userName",
 | 
			
		||||
      title: "员工姓名"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'temperature',
 | 
			
		||||
      title:'体温'
 | 
			
		||||
      key: "temperature",
 | 
			
		||||
      title: "体温"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'bodyImageUrl',
 | 
			
		||||
      title:'衣着图片',
 | 
			
		||||
      key: "bodyImageUrl",
 | 
			
		||||
      title: "衣着图片",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-image
 | 
			
		||||
| 
						 | 
				
			
			@ -116,8 +116,8 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'handImageUrl',
 | 
			
		||||
      title:'手心图片',
 | 
			
		||||
      key: "handImageUrl",
 | 
			
		||||
      title: "手心图片",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-image
 | 
			
		||||
| 
						 | 
				
			
			@ -128,8 +128,8 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'handbackImageUrl',
 | 
			
		||||
      title:'手背图片',
 | 
			
		||||
      key: "handbackImageUrl",
 | 
			
		||||
      title: "手背图片",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-image
 | 
			
		||||
| 
						 | 
				
			
			@ -140,8 +140,8 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'headImageUrl',
 | 
			
		||||
      title:'头部图片',
 | 
			
		||||
      key: "headImageUrl",
 | 
			
		||||
      title: "头部图片",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-image
 | 
			
		||||
| 
						 | 
				
			
			@ -152,8 +152,8 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'diseases',
 | 
			
		||||
      title:'健康状态',
 | 
			
		||||
      key: "diseases",
 | 
			
		||||
      title: "健康状态",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-tag type="success">
 | 
			
		||||
| 
						 | 
				
			
			@ -163,8 +163,8 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'checkResultStr',
 | 
			
		||||
      title:'晨检结果',
 | 
			
		||||
      key: "checkResultStr",
 | 
			
		||||
      title: "晨检结果",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-tag type="success">
 | 
			
		||||
| 
						 | 
				
			
			@ -174,7 +174,7 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'checkInTime',
 | 
			
		||||
      key: "checkInTime",
 | 
			
		||||
      title: "打卡时间"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -185,61 +185,43 @@
 | 
			
		|||
      key: "",
 | 
			
		||||
      title: "操作",
 | 
			
		||||
      width: 200,
 | 
			
		||||
      render: (value:HardwareData) => {
 | 
			
		||||
      render: (value: HardwareData) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <div style={{ display: "flex" }}>
 | 
			
		||||
            <n-button>查看</n-button>
 | 
			
		||||
            <NPopconfirm
 | 
			
		||||
              onPositiveClick={async () => {
 | 
			
		||||
              }}
 | 
			
		||||
              onNegativeClick={() => {
 | 
			
		||||
              }}
 | 
			
		||||
              showIcon={false}
 | 
			
		||||
            >
 | 
			
		||||
              {{
 | 
			
		||||
                trigger: () => (
 | 
			
		||||
                  <n-button
 | 
			
		||||
                    strong
 | 
			
		||||
                    secondary
 | 
			
		||||
                    style={{ marginLeft: "10px" }}
 | 
			
		||||
                    type="error"
 | 
			
		||||
                  >
 | 
			
		||||
                    删除
 | 
			
		||||
                  </n-button>
 | 
			
		||||
                ),
 | 
			
		||||
                default: () => "确认要除么?"
 | 
			
		||||
              }}
 | 
			
		||||
            </NPopconfirm>
 | 
			
		||||
            <n-button strong
 | 
			
		||||
                      secondary
 | 
			
		||||
                      type="primary">查看
 | 
			
		||||
            </n-button>
 | 
			
		||||
          </div>
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ]);
 | 
			
		||||
  const workAccountsValueList = {
 | 
			
		||||
    bodyImage:"",
 | 
			
		||||
    bodyImageUrl :"",
 | 
			
		||||
    checkResultStr:"",
 | 
			
		||||
    checkStatusStr:"",
 | 
			
		||||
    createTime:"",
 | 
			
		||||
    createTimeStr:"",
 | 
			
		||||
    diseases:"",
 | 
			
		||||
    handImageUrl:"",
 | 
			
		||||
    handbackImageUrl:"",
 | 
			
		||||
    headImageUrl :"",
 | 
			
		||||
    isDefault:true,
 | 
			
		||||
    sexStr:"",
 | 
			
		||||
    temperature:"",
 | 
			
		||||
    updateTime :"",
 | 
			
		||||
    userName:"",
 | 
			
		||||
  }
 | 
			
		||||
    bodyImage: "",
 | 
			
		||||
    bodyImageUrl: "",
 | 
			
		||||
    checkResultStr: "",
 | 
			
		||||
    checkStatusStr: "",
 | 
			
		||||
    createTime: "",
 | 
			
		||||
    createTimeStr: "",
 | 
			
		||||
    diseases: "",
 | 
			
		||||
    handImageUrl: "",
 | 
			
		||||
    handbackImageUrl: "",
 | 
			
		||||
    headImageUrl: "",
 | 
			
		||||
    isDefault: true,
 | 
			
		||||
    sexStr: "",
 | 
			
		||||
    temperature: "",
 | 
			
		||||
    updateTime: "",
 | 
			
		||||
    userName: ""
 | 
			
		||||
  };
 | 
			
		||||
  const userValue = ref<HardwareData>({
 | 
			
		||||
    ...workAccountsValueList
 | 
			
		||||
  });
 | 
			
		||||
  const resetModelValue = () => {
 | 
			
		||||
    userValue.value = { ...workAccountsValueList };
 | 
			
		||||
    title.value = '添加晨检记录'
 | 
			
		||||
    title.value = "添加晨检记录";
 | 
			
		||||
  };
 | 
			
		||||
  const addUserOrUpdate =  () => {
 | 
			
		||||
  const addUserOrUpdate = () => {
 | 
			
		||||
    forms.value?.validate().then(() => {
 | 
			
		||||
      // loading.value = true
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -298,7 +280,7 @@
 | 
			
		|||
  //   });
 | 
			
		||||
  // }
 | 
			
		||||
 | 
			
		||||
//   电子秤
 | 
			
		||||
  //   电子秤
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  const reqApiElectronicScale: TableType["requestApi"] = (params) => {
 | 
			
		||||
| 
						 | 
				
			
			@ -321,94 +303,84 @@
 | 
			
		|||
  const searchFormOptionsElectronicScale = reactive<TableType["searchFormOptions"]>({
 | 
			
		||||
    time: {
 | 
			
		||||
      type: "datePicker",
 | 
			
		||||
      label: "时间",
 | 
			
		||||
      label: "时间"
 | 
			
		||||
    },
 | 
			
		||||
    userName:{
 | 
			
		||||
      type:'input',
 | 
			
		||||
    userName: {
 | 
			
		||||
      type: "input",
 | 
			
		||||
      label: "负责人"
 | 
			
		||||
    },
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
  const columnsElectronicScale = ref<TableType["columns"]>([
 | 
			
		||||
    {
 | 
			
		||||
      key:'personInCharge',
 | 
			
		||||
      title:'负责人'
 | 
			
		||||
      key: "personInCharge",
 | 
			
		||||
      title: "负责人"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'deviceModel',
 | 
			
		||||
      title:'设备型号'
 | 
			
		||||
      key: "image",
 | 
			
		||||
      title: "食材图片",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-image
 | 
			
		||||
            width="30"
 | 
			
		||||
            src={value.image}
 | 
			
		||||
          />
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'unit',
 | 
			
		||||
      title:'单位'
 | 
			
		||||
      key: "deviceModel",
 | 
			
		||||
      title: "设备型号"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'serialNumber',
 | 
			
		||||
      title:'序列号'
 | 
			
		||||
      key: "unit",
 | 
			
		||||
      title: "单位"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'nameOfIngredients',
 | 
			
		||||
      title:'食材名称'
 | 
			
		||||
      key: "serialNumber",
 | 
			
		||||
      title: "序列号"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'quantityOfIngredients',
 | 
			
		||||
      title:'食材数量'
 | 
			
		||||
      key: "nameOfIngredients",
 | 
			
		||||
      title: "食材名称"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'weight',
 | 
			
		||||
      title:'重量值'
 | 
			
		||||
      key: "quantityOfIngredients",
 | 
			
		||||
      title: "食材数量"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'steadyState',
 | 
			
		||||
      title:'重量是否稳定'
 | 
			
		||||
      key: "weight",
 | 
			
		||||
      title: "重量值"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'outOfRange',
 | 
			
		||||
      title:'是否超出量程范围'
 | 
			
		||||
      key: "steadyState",
 | 
			
		||||
      title: "重量是否稳定"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'weighingTime',
 | 
			
		||||
      title:'称重时间'
 | 
			
		||||
      key: "outOfRange",
 | 
			
		||||
      title: "是否超出量程范围"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'',
 | 
			
		||||
      title:'操作',
 | 
			
		||||
      render:(value:ElectronicScale)=>{
 | 
			
		||||
         return (
 | 
			
		||||
           <div style={{ display: "flex" }}>
 | 
			
		||||
             <n-button
 | 
			
		||||
               strong
 | 
			
		||||
               secondary
 | 
			
		||||
               type="primary"
 | 
			
		||||
             >
 | 
			
		||||
               查看
 | 
			
		||||
             </n-button>
 | 
			
		||||
             <NPopconfirm
 | 
			
		||||
               onPositiveClick={async () => {
 | 
			
		||||
               }}
 | 
			
		||||
               onNegativeClick={() => {
 | 
			
		||||
               }}
 | 
			
		||||
               showIcon={false}
 | 
			
		||||
             >
 | 
			
		||||
               {{
 | 
			
		||||
                 trigger: () => (
 | 
			
		||||
                   <n-button
 | 
			
		||||
                     strong
 | 
			
		||||
                     secondary
 | 
			
		||||
                     style={{ marginLeft: "10px" }}
 | 
			
		||||
                     type="error"
 | 
			
		||||
                   >
 | 
			
		||||
                     删除
 | 
			
		||||
                   </n-button>
 | 
			
		||||
                 ),
 | 
			
		||||
                 default: () => "确认要除么?"
 | 
			
		||||
               }}
 | 
			
		||||
             </NPopconfirm>
 | 
			
		||||
           </div>
 | 
			
		||||
         )
 | 
			
		||||
      key: "weighingTime",
 | 
			
		||||
      title: "称重时间"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "",
 | 
			
		||||
      title: "操作",
 | 
			
		||||
      render: (value: ElectronicScale) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <div style={{ display: "flex" }}>
 | 
			
		||||
            <n-button
 | 
			
		||||
              strong
 | 
			
		||||
              secondary
 | 
			
		||||
              type="primary"
 | 
			
		||||
            >
 | 
			
		||||
              查看
 | 
			
		||||
            </n-button>
 | 
			
		||||
          </div>
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ])
 | 
			
		||||
 | 
			
		||||
  ]);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  const reqApiCameraDate: TableType["requestApi"] = (params) => {
 | 
			
		||||
| 
						 | 
				
			
			@ -431,25 +403,25 @@
 | 
			
		|||
  const searchFormOptionsCameraDate = reactive<TableType["searchFormOptions"]>({
 | 
			
		||||
    time: {
 | 
			
		||||
      type: "datePicker",
 | 
			
		||||
      label: "时间",
 | 
			
		||||
      label: "时间"
 | 
			
		||||
    },
 | 
			
		||||
    userName:{
 | 
			
		||||
      type:'input',
 | 
			
		||||
    userName: {
 | 
			
		||||
      type: "input",
 | 
			
		||||
      label: "摄像头名称"
 | 
			
		||||
    },
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
  const columnsCameraDate = ref<TableType["columns"]>([
 | 
			
		||||
    {
 | 
			
		||||
      key:'id',
 | 
			
		||||
      title:'ID'
 | 
			
		||||
      key: "id",
 | 
			
		||||
      title: "ID"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'cameraName',
 | 
			
		||||
      title:'摄像头名称'
 | 
			
		||||
      key: "cameraName",
 | 
			
		||||
      title: "摄像头名称"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'images',
 | 
			
		||||
      title:'现场图片',
 | 
			
		||||
      key: "images",
 | 
			
		||||
      title: "现场图片",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-image
 | 
			
		||||
| 
						 | 
				
			
			@ -460,12 +432,12 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'videoChannel',
 | 
			
		||||
      title:'视频通道id'
 | 
			
		||||
      key: "videoChannel",
 | 
			
		||||
      title: "视频通道id"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'states',
 | 
			
		||||
      title:'状态',
 | 
			
		||||
      key: "states",
 | 
			
		||||
      title: "状态",
 | 
			
		||||
      render: (value: any) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <n-tag type="success">
 | 
			
		||||
| 
						 | 
				
			
			@ -475,25 +447,25 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'cameraID',
 | 
			
		||||
      title:'录像机ID'
 | 
			
		||||
      key: "cameraID",
 | 
			
		||||
      title: "录像机ID"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'updatedBy',
 | 
			
		||||
      title:'更新人'
 | 
			
		||||
      key: "updatedBy",
 | 
			
		||||
      title: "更新人"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'founder',
 | 
			
		||||
      title:'创建人'
 | 
			
		||||
      key: "founder",
 | 
			
		||||
      title: "创建人"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'updateTime',
 | 
			
		||||
      title:'更新时间'
 | 
			
		||||
      key: "updateTime",
 | 
			
		||||
      title: "更新时间"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key:'',
 | 
			
		||||
      title:'操作',
 | 
			
		||||
      render:(value:ElectronicScale)=>{
 | 
			
		||||
      key: "",
 | 
			
		||||
      title: "操作",
 | 
			
		||||
      render: (value: ElectronicScale) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <div style={{ display: "flex" }}>
 | 
			
		||||
            <n-button
 | 
			
		||||
| 
						 | 
				
			
			@ -503,31 +475,10 @@
 | 
			
		|||
            >
 | 
			
		||||
              查看
 | 
			
		||||
            </n-button>
 | 
			
		||||
            <NPopconfirm
 | 
			
		||||
              onPositiveClick={async () => {
 | 
			
		||||
              }}
 | 
			
		||||
              onNegativeClick={() => {
 | 
			
		||||
              }}
 | 
			
		||||
              showIcon={false}
 | 
			
		||||
            >
 | 
			
		||||
              {{
 | 
			
		||||
                trigger: () => (
 | 
			
		||||
                  <n-button
 | 
			
		||||
                    strong
 | 
			
		||||
                    secondary
 | 
			
		||||
                    style={{ marginLeft: "10px" }}
 | 
			
		||||
                    type="error"
 | 
			
		||||
                  >
 | 
			
		||||
                    删除
 | 
			
		||||
                  </n-button>
 | 
			
		||||
                ),
 | 
			
		||||
                default: () => "确认要除么?"
 | 
			
		||||
              }}
 | 
			
		||||
            </NPopconfirm>
 | 
			
		||||
          </div>
 | 
			
		||||
        )
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ])
 | 
			
		||||
  ]);
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang="scss"></style>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,65 @@
 | 
			
		|||
export  interface purchaseOrderType{
 | 
			
		||||
  applicant?:string,
 | 
			
		||||
  contactNumber?:string,
 | 
			
		||||
  orderNumber?:string,
 | 
			
		||||
  supplierName?:string,
 | 
			
		||||
  book_Date?:string,
 | 
			
		||||
  deliveryAddress?:string,
 | 
			
		||||
  latestDeliveryTime?:string,
 | 
			
		||||
  itemName?:string,
 | 
			
		||||
  specifications?:string,
 | 
			
		||||
  itemNumber?:string,
 | 
			
		||||
  unitPrice?:string
 | 
			
		||||
  TotalPrice?:string
 | 
			
		||||
  Remarks?:string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const purchaseOrderData:purchaseOrderType[] = [
 | 
			
		||||
  {
 | 
			
		||||
    applicant:'王经理',
 | 
			
		||||
    contactNumber:'13575462514',
 | 
			
		||||
    orderNumber:'CG-20250516-001',
 | 
			
		||||
    supplierName:'XX粮油有限公司',
 | 
			
		||||
    book_Date:'2025-5-16 14:35:12',
 | 
			
		||||
    deliveryAddress:'XX大学南门仓库',
 | 
			
		||||
    latestDeliveryTime:'2025-5-22 00:00:00',
 | 
			
		||||
    itemName:'金龙鱼',
 | 
			
		||||
    specifications:'5L/桶',
 | 
			
		||||
    itemNumber:'20',
 | 
			
		||||
    unitPrice:'¥50',
 | 
			
		||||
    TotalPrice:"¥1000",
 | 
			
		||||
    Remarks:'非转基因'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    applicant:'王经理',
 | 
			
		||||
    contactNumber:'13575462514',
 | 
			
		||||
    orderNumber:'CG-20250517-001',
 | 
			
		||||
    supplierName:'XX农副产品有限公司”',
 | 
			
		||||
    book_Date:'2025-5-17 14:35:12',
 | 
			
		||||
    deliveryAddress:'XX大学南门仓库',
 | 
			
		||||
    latestDeliveryTime:'2025-5-22 00:00:00',
 | 
			
		||||
    itemName:'红胡萝卜',
 | 
			
		||||
    specifications:'100斤',
 | 
			
		||||
    itemNumber:'1袋',
 | 
			
		||||
    unitPrice:'¥5',
 | 
			
		||||
    TotalPrice:"¥500",
 | 
			
		||||
    Remarks:''
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    applicant:'王经理',
 | 
			
		||||
    contactNumber:'13575462514',
 | 
			
		||||
    orderNumber:'CG-20250518-001',
 | 
			
		||||
    supplierName:'XX农副产品有限公司”',
 | 
			
		||||
    book_Date:'2025-5-18 14:35:12',
 | 
			
		||||
    deliveryAddress:'XX大学南门仓库',
 | 
			
		||||
    latestDeliveryTime:'2025-5-22 00:00:00',
 | 
			
		||||
    itemName:'苹果',
 | 
			
		||||
    specifications:'100斤',
 | 
			
		||||
    itemNumber:'5箱',
 | 
			
		||||
    unitPrice:'¥6',
 | 
			
		||||
    TotalPrice:"¥600",
 | 
			
		||||
    Remarks:''
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
export default purchaseOrderData
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,265 @@
 | 
			
		|||
<!-- 采购计划 -->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>采购订单下发</div>
 | 
			
		||||
  <div>
 | 
			
		||||
    <TablePro
 | 
			
		||||
      ref="tableRef"
 | 
			
		||||
      :request-api="reqApi"
 | 
			
		||||
      :search-form-options="searchFormOptions"
 | 
			
		||||
      :columns="columns"
 | 
			
		||||
      :isPageTable="true"
 | 
			
		||||
      :single-line="false"
 | 
			
		||||
    >
 | 
			
		||||
      <template #headerExtra>
 | 
			
		||||
        <n-button
 | 
			
		||||
          strong
 | 
			
		||||
          secondary
 | 
			
		||||
          type="primary"
 | 
			
		||||
          @click="addPurchaseOrder"
 | 
			
		||||
        >
 | 
			
		||||
          添加
 | 
			
		||||
        </n-button>
 | 
			
		||||
        <n-button style="margin-left: 10px">一键采购</n-button>
 | 
			
		||||
      </template>
 | 
			
		||||
    </TablePro>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script setup></script>
 | 
			
		||||
<script setup lang="tsx">
 | 
			
		||||
  import {
 | 
			
		||||
    TablePro,
 | 
			
		||||
    type TableProProps,
 | 
			
		||||
    FormPro,
 | 
			
		||||
    type FormItemOptions,
 | 
			
		||||
    type TableProInst,
 | 
			
		||||
    Icon
 | 
			
		||||
  } from "@/components";
 | 
			
		||||
  import { type FormInst, NPerformantEllipsis, NPopconfirm, NTag, useModal } from "naive-ui";
 | 
			
		||||
  import purchaseOrderData, { type purchaseOrderType } from "@/views/personnelManagement/purchaseOrder/index.ts";
 | 
			
		||||
  import { ref,reactive } from "vue";
 | 
			
		||||
 | 
			
		||||
  const tableRef = useTemplateRef<TableProInst>("tableRef");
 | 
			
		||||
  const modal = useModal();
 | 
			
		||||
  const form = ref<FormInst | null>(null);
 | 
			
		||||
  const reqApi: TableType["requestApi"] = (params) => {
 | 
			
		||||
    return new Promise((resolve) => {
 | 
			
		||||
      resolve({
 | 
			
		||||
        code: 200,
 | 
			
		||||
        data: {
 | 
			
		||||
          current: "1",
 | 
			
		||||
          // @ts-ignore
 | 
			
		||||
          pages: "2",
 | 
			
		||||
          records: purchaseOrderData,
 | 
			
		||||
          size: "10",
 | 
			
		||||
          total: "12"
 | 
			
		||||
        },
 | 
			
		||||
        message: "操作成功!"
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
  type TableType = TableProProps<any, any>;
 | 
			
		||||
  const searchFormOptions = reactive<TableType["searchFormOptions"]>({
 | 
			
		||||
    name: {
 | 
			
		||||
      type: "input",
 | 
			
		||||
      label: "物品名称"
 | 
			
		||||
    },
 | 
			
		||||
    time: {
 | 
			
		||||
      type: "datePicker",
 | 
			
		||||
      label: "时间"
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const columns = ref<TableType["columns"]>([
 | 
			
		||||
    {
 | 
			
		||||
      key: "applicant",
 | 
			
		||||
      title: "联系人"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "contactNumber",
 | 
			
		||||
      title: "联系电话"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "orderNumber",
 | 
			
		||||
      title: "订单编号"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "supplierName",
 | 
			
		||||
      title: "供应商名称"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "book_Date",
 | 
			
		||||
      title: "下单日期"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "deliveryAddress",
 | 
			
		||||
      title: "交货地址"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "latestDeliveryTime",
 | 
			
		||||
      title: "最晚交货时间"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "itemName",
 | 
			
		||||
      title: "物品名称"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "specifications",
 | 
			
		||||
      title: "规格"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "itemNumber",
 | 
			
		||||
      title: "数量"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "unitPrice",
 | 
			
		||||
      title: "单价"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "TotalPrice",
 | 
			
		||||
      title: "总价"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "Remarks",
 | 
			
		||||
      title: "备注"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      key: "",
 | 
			
		||||
      title: "操作",
 | 
			
		||||
      render: (value) => {
 | 
			
		||||
        return (
 | 
			
		||||
          <div style={{ display: "flex" }}>
 | 
			
		||||
            <n-button
 | 
			
		||||
              strong
 | 
			
		||||
              secondary
 | 
			
		||||
              style={{ marginLeft: "10px" }}
 | 
			
		||||
              type="success"
 | 
			
		||||
              onClick={() => {
 | 
			
		||||
              }}
 | 
			
		||||
            >
 | 
			
		||||
              修改
 | 
			
		||||
            </n-button>
 | 
			
		||||
            <n-button
 | 
			
		||||
              strong
 | 
			
		||||
              secondary
 | 
			
		||||
              style={{ marginLeft: "10px" }}
 | 
			
		||||
              type="warning"
 | 
			
		||||
              onClick={() => {
 | 
			
		||||
              }}
 | 
			
		||||
            >
 | 
			
		||||
              详情
 | 
			
		||||
            </n-button>
 | 
			
		||||
            <NPopconfirm
 | 
			
		||||
              onPositiveClick={async () => {
 | 
			
		||||
              }}
 | 
			
		||||
              onNegativeClick={() => {
 | 
			
		||||
              }}
 | 
			
		||||
              showIcon={false}
 | 
			
		||||
            >
 | 
			
		||||
              {{
 | 
			
		||||
                trigger: () => (
 | 
			
		||||
                  <n-button
 | 
			
		||||
                    strong
 | 
			
		||||
                    secondary
 | 
			
		||||
                    style={{ marginLeft: "10px" }}
 | 
			
		||||
                    type="error"
 | 
			
		||||
                  >
 | 
			
		||||
                    删除
 | 
			
		||||
                  </n-button>
 | 
			
		||||
                ),
 | 
			
		||||
                default: () => "确认要删除么?"
 | 
			
		||||
              }}
 | 
			
		||||
            </NPopconfirm>
 | 
			
		||||
          </div>
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ]);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  const userDefaultValue: purchaseOrderType = {
 | 
			
		||||
    applicant: "",
 | 
			
		||||
    contactNumber: "",
 | 
			
		||||
    orderNumber: "",
 | 
			
		||||
    supplierName: "",
 | 
			
		||||
    book_Date: "",
 | 
			
		||||
    deliveryAddress: "",
 | 
			
		||||
    latestDeliveryTime: "",
 | 
			
		||||
    itemName: "",
 | 
			
		||||
    specifications: "",
 | 
			
		||||
    itemNumber: "",
 | 
			
		||||
    unitPrice: "",
 | 
			
		||||
    TotalPrice: "",
 | 
			
		||||
    Remarks: ""
 | 
			
		||||
  };
 | 
			
		||||
  const purchaseOrderValue = ref<purchaseOrderType>({
 | 
			
		||||
    ...userDefaultValue
 | 
			
		||||
  });
 | 
			
		||||
  const resetModelValue = () => {
 | 
			
		||||
    purchaseOrderValue.value = { ...userDefaultValue };
 | 
			
		||||
    title.value = "新增订单";
 | 
			
		||||
  };
 | 
			
		||||
  const addUserOrUpdate = () => {
 | 
			
		||||
    form.value?.validate().then(() => {
 | 
			
		||||
      // loading.value = true
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  const formOptionsUser = reactive<FormItemOptions<any>>({
 | 
			
		||||
    applicant:{
 | 
			
		||||
      type: "input",
 | 
			
		||||
      label: "联系人",
 | 
			
		||||
      required: true,
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
  const modalRef = ref();
 | 
			
		||||
  const title = ref("新增订单");
 | 
			
		||||
  const loading = ref<boolean>(false);
 | 
			
		||||
  const addPurchaseOrder = () => {
 | 
			
		||||
    modalRef.value = modal.create({
 | 
			
		||||
      title: title.value,
 | 
			
		||||
      preset: "card",
 | 
			
		||||
      style: {
 | 
			
		||||
        width: "600px"
 | 
			
		||||
      },
 | 
			
		||||
      content: () => (
 | 
			
		||||
        <>
 | 
			
		||||
          <FormPro
 | 
			
		||||
            labelWidth="100"
 | 
			
		||||
            ref={form}
 | 
			
		||||
            v-model:value={purchaseOrderValue.value}
 | 
			
		||||
            form-item-options={formOptionsUser}
 | 
			
		||||
          ></FormPro>
 | 
			
		||||
        </>
 | 
			
		||||
      ),
 | 
			
		||||
      footer: () => (
 | 
			
		||||
        <div
 | 
			
		||||
          style={{
 | 
			
		||||
            display: "flex",
 | 
			
		||||
            justifyContent: "flex-end"
 | 
			
		||||
          }}
 | 
			
		||||
        >
 | 
			
		||||
          <n-button
 | 
			
		||||
            loading={loading.value}
 | 
			
		||||
            style={{ marginRight: "10px" }}
 | 
			
		||||
            type="primary"
 | 
			
		||||
            onClick={() => {
 | 
			
		||||
              addUserOrUpdate();
 | 
			
		||||
            }}
 | 
			
		||||
          >
 | 
			
		||||
            确认
 | 
			
		||||
          </n-button>
 | 
			
		||||
          <n-button
 | 
			
		||||
            onClick={() => {
 | 
			
		||||
              modalRef.value.destroy();
 | 
			
		||||
              resetModelValue();
 | 
			
		||||
            }}
 | 
			
		||||
          >
 | 
			
		||||
            取消
 | 
			
		||||
          </n-button>
 | 
			
		||||
        </div>
 | 
			
		||||
      ),
 | 
			
		||||
      onAfterLeave: () => {
 | 
			
		||||
        resetModelValue();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang="scss"></style>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,14 +10,14 @@
 | 
			
		|||
      :single-line="false"
 | 
			
		||||
    >
 | 
			
		||||
      <template #headerExtra>
 | 
			
		||||
        <n-button
 | 
			
		||||
          strong
 | 
			
		||||
          secondary
 | 
			
		||||
          type="primary"
 | 
			
		||||
          @click="addWorkAccounts"
 | 
			
		||||
        >
 | 
			
		||||
          添加
 | 
			
		||||
        </n-button>
 | 
			
		||||
<!--        <n-button-->
 | 
			
		||||
<!--          strong-->
 | 
			
		||||
<!--          secondary-->
 | 
			
		||||
<!--          type="primary"-->
 | 
			
		||||
<!--          @click="addWorkAccounts"-->
 | 
			
		||||
<!--        >-->
 | 
			
		||||
<!--          添加-->
 | 
			
		||||
<!--        </n-button>-->
 | 
			
		||||
      <n-button style="margin-left: 10px">一键导出</n-button>
 | 
			
		||||
      </template>
 | 
			
		||||
    </TablePro>
 | 
			
		||||
| 
						 | 
				
			
			@ -221,7 +221,7 @@
 | 
			
		|||
 | 
			
		||||
              }}
 | 
			
		||||
            >
 | 
			
		||||
              修改
 | 
			
		||||
              查看
 | 
			
		||||
            </n-button>
 | 
			
		||||
 | 
			
		||||
            <NPopconfirm
 | 
			
		||||
| 
						 | 
				
			
			@ -330,6 +330,9 @@
 | 
			
		|||
      type: "select",
 | 
			
		||||
      label: "员工",
 | 
			
		||||
      required:true,
 | 
			
		||||
      componentsProps:{
 | 
			
		||||
        disabled:true
 | 
			
		||||
      },
 | 
			
		||||
      options:[
 | 
			
		||||
        {
 | 
			
		||||
          value:'张三',
 | 
			
		||||
| 
						 | 
				
			
			@ -356,7 +359,10 @@
 | 
			
		|||
    temperature:{
 | 
			
		||||
       type:'input',
 | 
			
		||||
       label:'体温',
 | 
			
		||||
      required:true
 | 
			
		||||
      required:true,
 | 
			
		||||
      componentsProps:{
 | 
			
		||||
          disabled:true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    bodyImageUrl:{
 | 
			
		||||
      type: "custom",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue