瀏覽代碼

发票申请 暂存

xiaodai2017 2 年之前
父節點
當前提交
907824d8e6

+ 15 - 0
src/api/components/examRecord.ts

@@ -0,0 +1,15 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+interface ResponseType extends Promise<any> {
+  data?: object;
+  code?: number;
+  msg?: string;
+}
+
+// 审批记录列表
+export const httpList = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}rolelist`, { data });
+};

+ 3 - 0
src/components/examRecord/index.ts

@@ -0,0 +1,3 @@
+import examRecord from "./src/exam-record.vue";
+
+export { examRecord };

+ 50 - 0
src/components/examRecord/src/exam-record.vue

@@ -0,0 +1,50 @@
+<script setup lang="ts">
+import { ref, watch } from "vue";
+import { httpList } from "/@/api/components/examRecord";
+import { modalProps } from "./types";
+import { responseHandle } from "/@/utils/responseHandle";
+import { useNav } from "/@/layout/hooks/nav";
+const { logout } = useNav();
+const props = defineProps(modalProps);
+const code = ref("");
+const options = ref([]);
+defineExpose({
+  code
+});
+async function getList(examCode) {
+  const { code, data, message } = await httpList({ examCode });
+  responseHandle({
+    code,
+    message,
+    logout,
+    handler: () => {
+      options.value = data ?? [];
+    }
+  });
+}
+watch(
+  () => props.examCode,
+  newVal => {
+    console.log(newVal);
+    getList(newVal);
+
+    // code.value = newVal;
+  }
+);
+</script>
+
+<template>
+  <el-timeline>
+    <el-timeline-item
+      v-for="(si, sii) in options"
+      :key="'examItem' + si.addtime + sii"
+      :timestamp="si.addtime"
+      placement="top"
+    >
+      <el-card>
+        <h4>{{ si.action_name }}</h4>
+        <p>{{ si.re }}</p>
+      </el-card>
+    </el-timeline-item>
+  </el-timeline>
+</template>

+ 6 - 0
src/components/examRecord/src/types.ts

@@ -0,0 +1,6 @@
+export const modalProps = {
+  examCode: {
+    type: String,
+    required: true
+  }
+};

+ 3 - 0
src/components/viewDescriptions/index.ts

@@ -0,0 +1,3 @@
+import examRecord from "./src/exam-record.vue";
+
+export { examRecord };

+ 50 - 0
src/components/viewDescriptions/src/exam-record.vue

@@ -0,0 +1,50 @@
+<script setup lang="ts">
+import { ref, watch } from "vue";
+import { httpList } from "/@/api/components/examRecord";
+import { modalProps } from "./types";
+import { responseHandle } from "/@/utils/responseHandle";
+import { useNav } from "/@/layout/hooks/nav";
+const { logout } = useNav();
+const props = defineProps(modalProps);
+const code = ref("");
+const options = ref([]);
+defineExpose({
+  code
+});
+async function getList(examCode) {
+  const { code, data, message } = await httpList({ examCode });
+  responseHandle({
+    code,
+    message,
+    logout,
+    handler: () => {
+      options.value = data ?? [];
+    }
+  });
+}
+watch(
+  () => props.examCode,
+  newVal => {
+    console.log(newVal);
+    getList(newVal);
+
+    // code.value = newVal;
+  }
+);
+</script>
+
+<template>
+  <el-timeline>
+    <el-timeline-item
+      v-for="(si, sii) in options"
+      :key="'examItem' + si.addtime + sii"
+      :timestamp="si.addtime"
+      placement="top"
+    >
+      <el-card>
+        <h4>{{ si.action_name }}</h4>
+        <p>{{ si.re }}</p>
+      </el-card>
+    </el-timeline-item>
+  </el-timeline>
+</template>

+ 5 - 0
src/components/viewDescriptions/src/types.ts

@@ -0,0 +1,5 @@
+import { FormItem } from "/@/components/BasicForm";
+export const modalProps = {
+  formItems: Array as PropType<Array<FormItem>>,
+  required: true
+};

+ 20 - 0
src/components/viewDescriptions/src/viewDescriptions.vue

@@ -0,0 +1,20 @@
+<script setup lang="ts">
+import { useNav } from "/@/layout/hooks/nav";
+
+enum FROM_TYPE {
+  create = "create",
+  edit = "edit",
+  view = "view"
+}
+const { logout } = useNav();
+</script>
+
+<template>
+  <el-descriptions :column="1" border>
+    <!-- <template v-for="(item, index) in config.formItems" :key="index">
+      <el-descriptions-item :label="item.label" align="center">{{
+        defaultInfo[item.field]
+      }}</el-descriptions-item>
+    </template> -->
+  </el-descriptions>
+</template>

+ 0 - 1
src/views/InvoiceSales/invoiceApply/components/examStatusForm.vue

@@ -207,7 +207,6 @@ defineExpose({
       :model="ruleForm"
       :rules="rules"
       label-width="90px"
-      style="margin-top: -10px"
       class="demo-ruleForm"
       status-icon
     >

+ 0 - 1
src/views/InvoiceSales/invoiceApply/components/logisticsForm.vue

@@ -192,7 +192,6 @@ defineExpose({
         :model="ruleForm"
         :rules="rules"
         label-width="90px"
-        style="margin-top: -10px"
         class="demo-ruleForm"
         status-icon
       >

+ 33 - 92
src/views/InvoiceSales/invoiceApply/detail.vue

@@ -1,110 +1,38 @@
 <script setup lang="ts">
-import { useColumns } from "./columns";
 import { httpList } from "/@/api/InvoiceSales/invoiceApply";
 import { reactive, ref, onMounted } from "vue";
 
-import { TableProBar } from "/@/components/ReTable";
-import { type PaginationProps } from "@pureadmin/table";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
-import { useNav } from "/@/layout/hooks/nav";
-import { statusList, inv_type_list } from "./status";
-import { useRouter } from "vue-router";
-import { responseHandle } from "/@/utils/responseHandle";
+// import { useNav } from "/@/layout/hooks/nav";
 import addEditForm from "./components/addEditForm.vue";
 import examStatusForm from "./components/examStatusForm.vue";
-const { logout } = useNav();
+console.log("/@/components/examRecord");
+import { examRecord } from "/@/components/examRecord";
+// const { logout } = useNav();
 defineOptions({
   name: "InvoiceApplyDetail"
 });
-
-const initform = {
-  buy_id: "", //客户公司
-  companyNo: "", //业务企业公司
-  khNo: "", //申请人
-  invtype: "",
-  email: "",
-  remark: "",
-  orderArr: []
-};
-const id = ref("");
-const form = reactive({ ...initform });
-const startDisabledDate = (time: Date) => {
-  const { end } = form;
-  if (end ?? "") {
-    return time.getTime() > Date.now(end).valueOf();
-  }
-};
-const endDisabledDate = (time: Date) => {
-  const { start } = form;
-  if (start ?? "") {
-    return time.getTime() < Date.now(start).valueOf();
-  }
-};
-const { push } = useRouter();
-const dataList = ref([]);
+const activeName = ref("0");
+const collapseItem = ref(["0", "1", "2", "3"]);
 const loading = ref(false);
-const { columns } = useColumns();
-
-const pagination = reactive<PaginationProps>({
-  total: 0,
-  pageSize: 15,
-  currentPage: 1,
-  background: true
-});
-
-async function handleCurrentChange(val: number) {
-  form.page = val;
-  await onSearch();
-}
-
-async function handleSizeChange(val: number) {
-  form.size = val;
-  form.page = 1;
-  await onSearch();
-}
-
-function handleSelectionChange(val) {
-  console.log("handleSelectionChange", val);
-}
+const examCode = ref("");
+const dataList = ref([]);
 
 async function onSearch() {
   if (loading.value) return;
-  loading.value = true;
-  const { code, data, message } = await httpList(form);
-  responseHandle({
-    code,
-    message,
-    logout,
-    handler: () => {
-      const { list, count } = data;
-      dataList.value = list ?? [];
-      pagination.total = count ?? 0;
-      pagination.pageSize = form.size;
-      pagination.currentPage = form.page;
-    }
-  });
+  // loading.value = true;
+  // const { code, data, message } = await httpList(form);
+  // responseHandle({
+  //   code,
+  //   message,
+  //   logout,
+  //   handler: () => {
+
+  //   }
+  // });
 
   loading.value = false;
 }
-async function resetSearch() {
-  form.page = 1;
-  await onSearch();
-}
-//新建/详情页面
-function editItem(id) {
-  push({
-    path: "/InvoiceSales/invoiceApplyDeatil",
-    query: {
-      id
-    }
-  });
-}
-async function resetForm() {
-  Object.keys(form.value).forEach(key => {
-    form.value[key] = initform[key];
-  });
-  await onSearch();
-}
 
 onMounted(() => {
   onSearch();
@@ -113,8 +41,21 @@ onMounted(() => {
 
 <template>
   <div class="main bg-white">
-    <addEditForm />
-    <examStatusForm />
+    <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
+      <el-tab-pane label="新建发票申请" name="0">
+        <addEditForm />
+      </el-tab-pane>
+      <el-tab-pane label="业务详情" name="1">
+        <el-collapse v-model="collapseItem">
+          <el-collapse-item title="审核" name="1">
+            <examStatusForm />
+          </el-collapse-item>
+        </el-collapse>
+      </el-tab-pane>
+      <el-tab-pane label="审批记录" name="2">
+        <examRecord :examCode="examCode" />
+      </el-tab-pane>
+    </el-tabs>
   </div>
 </template>