فهرست منبع

fix:修复采购销售bug

snow 2 سال پیش
والد
کامیت
c4e6fdbe19

+ 31 - 1
src/views/InvoiceSaleSettings/basic-settings.vue

@@ -12,6 +12,8 @@ import BasicDescriptions, {
 
 import { httpCatlist, httpAdd } from "/@/api/InvoiceSaleSettings/commodityCost";
 
+let cachecode = "";
+
 const props = defineProps<{
   title: string;
   detail: any;
@@ -38,13 +40,39 @@ const formData = reactive({
   addTax: ""
 });
 
+const cat_code = computed(() => {
+  if (!props.detail) return "";
+  const { inv_cat_code } = props.detail;
+  return inv_cat_code;
+});
+
+async function requesetInvCatDetail() {
+  const { code, message, data } = await httpCatlist({
+    cat_code: cat_code.value
+  });
+
+  responseHandle({
+    code,
+    message,
+    handler: () => {
+      const { cat_name, cat_code, tax, addtax } = data[0] as any;
+      formData.cat_code = cat_name;
+      cachecode = cat_code;
+      formData.inv_good_name = props.detail.inv_good_name;
+      formData.tax = tax;
+      formData.addTax = addtax;
+    }
+  });
+}
+
 function handleSave() {
   formRef.value.validate(async isVaild => {
     if (!isVaild) return;
 
     const { code, message } = await httpAdd({
       spuCode: spuCode.value,
-      ...formData
+      ...formData,
+      cat_code: formData.cat_name ? formData.cat_code : cachecode
     });
 
     responseHandle({
@@ -84,6 +112,8 @@ watchEffect(() => {
 
   inv_tag_options.value = inv_tag.filter(i => tags.includes(i.value));
 });
+
+watchEffect(() => cat_code.value && requesetInvCatDetail());
 </script>
 
 <template>

+ 10 - 4
src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue

@@ -13,7 +13,7 @@ import { useRouter } from "vue-router";
 import { inv_type_list } from "./../../status";
 import InvoiceTitle from "./invoice-title.vue";
 import { convertInvoiceTitle } from "./columns";
-import { ADD_EDIT_FORM_RULES } from "./../../config/configs";
+import { ADD_EDIT_FORM_RULES, requried } from "./../../config/configs";
 
 enum FROM_TYPE {
   order = "order",
@@ -139,7 +139,13 @@ watchEffect(() => {
     mapSequenceNoToInvfee.value = {};
   }
 
-  rules.email[0].required = ["3", "4"].includes(invtype);
+  if (["3", "4"].includes(invtype)) {
+    rules.email[0].required = true;
+    rules.email[0].validator = requried;
+  } else {
+    rules.email[0].required = false;
+    rules.email[0].validator = () => true;
+  }
 });
 </script>
 
@@ -218,7 +224,7 @@ watchEffect(() => {
           <el-form-item label="开票备注" prop="remark" label-width="135px">
             <el-input
               w-full
-              v-model="ruleForm.exam_remark"
+              v-model="ruleForm.remark"
               :rows="3"
               type="textarea"
               maxlength="2000"
@@ -230,7 +236,7 @@ watchEffect(() => {
           <el-form-item label="申请备注" prop="exam_remark" label-width="135px">
             <el-input
               w-full
-              v-model="ruleForm.remark"
+              v-model="ruleForm.exam_remark"
               :rows="3"
               type="textarea"
               maxlength="2000"

+ 10 - 2
src/views/InvoiceSales/invoiceApply/components/add-edit-form/order-dialog.vue

@@ -16,6 +16,11 @@ const loading = ref(false);
 const dataList = ref([]);
 const tableRef = ref();
 const handleSelection = ref([]);
+
+// defineProps<{
+
+// }>()
+
 const pagination = reactive<PaginationProps>({
   total: 0,
   pageSize: 15,
@@ -77,7 +82,10 @@ function handleSelectionChange(val) {
 //列表展示
 async function onSearch() {
   loading.value = true;
-  const { code, data, message } = await httpOrderList(ruleForm.value);
+  const { code, data, message } = await httpOrderList({
+    cat_status: "1",
+    ...ruleForm.value
+  });
   responseHandle({
     code,
     message,
@@ -93,7 +101,7 @@ async function onSearch() {
   loading.value = false;
 }
 
-async function companyNo_change(buy: boolean) {
+async function companyNo_change() {
   const { customerNo } = ruleForm.value;
   console.log(customerNo);
 }

+ 25 - 12
src/views/InvoiceSales/invoiceApply/config/configs.ts

@@ -1,6 +1,12 @@
-import { isChinese, isIDentityCard, isEmoticon } from "/@/utils/validate";
+import { FormRules } from "element-plus";
+import {
+  isChinese,
+  isIDentityCard,
+  isEmoticon,
+  isEmail
+} from "/@/utils/validate";
 
-export const upload_invoice_rules = {
+export const upload_invoice_rules: FormRules = {
   status: [
     {
       required: true,
@@ -93,16 +99,7 @@ export const ADD_EDIT_FORM_RULES = {
 
   email: [
     {
-      required: true,
-      message: "请输入电子邮箱",
-      trigger: "blur"
-    }
-  ],
-  remark: [
-    {
-      required: true,
-      message: "请输入开票备注",
-      trigger: "blur"
+      required: true
     }
   ],
   id_number: [
@@ -129,5 +126,21 @@ export const ADD_EDIT_FORM_RULES = {
       message: "请输入申请备注",
       trigger: "blur"
     }
+  ],
+  remark: [
+    {
+      required: true,
+      message: "请输入开票备注",
+      trigger: "blur"
+    }
   ]
 };
+
+export const requried = (_, value, callback: any) => {
+  if (!value) {
+    return callback(new Error("邮箱不能为空"));
+  } else if (!isEmail(value)) {
+    return callback(new Error("邮箱格式不正确"));
+  }
+  return true;
+};

+ 26 - 36
src/views/InvoiceSales/invoiceApply/config/content.config.ts

@@ -1,6 +1,9 @@
 import { ContentConfig } from "/@/components/PageContent";
 import { httpList } from "/@/api/InvoiceSales/invoiceApply";
 import dayjs from "dayjs";
+import { ElTag } from "element-plus";
+import { inv_type_list, statusList } from "../status";
+import { h } from "vue";
 
 const columns = [
   {
@@ -39,42 +42,29 @@ const columns = [
     prop: "inv_value",
     width: 110
   },
-  //   {
-  //     label: "状态",
-  //     prop: "status",
-  //     minWidth: 80,
-  //     cellRenderer: ({ row, props }) => (
-  //       <el-tag
-  //         size={ props.size }
-  //         type={
-  //           (statusList.find(item => item.value == row.status + "") || {})
-  //       .type || "info"
-  //   }
-  //         effect = "plain"
-  //   >
-  //   {(statusList.find(item => item.value == row.status + "") || {})
-  //     .label || "--"}
-  // < /el-tag>
-  //     )
-  //   },
-  // {
-  //   label: "发票类型",
-  //     prop: "inv_type",
-  //       minWidth: 80,
-  //         cellRenderer: ({ row, props }) => (
-  //           <el-tag
-  //           size = { props.size }
-  //   type = {
-  //             (inv_type_list.find(item => item.value == row.inv_type + "") || {})
-  //     .type || "info"
-  // }
-  // effect = "plain"
-  //   >
-  //   {(inv_type_list.find(item => item.value == row.inv_type + "") || {})
-  //     .label || "--"}
-  // </el-tag>
-  //       )
-  //     },
+  {
+    label: "状态",
+    prop: "status",
+    minWidth: 80,
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () =>
+          statusList.find(item => item.value == row.status + "")?.label || "--"
+      });
+    }
+  },
+  {
+    label: "发票类型",
+    prop: "status",
+    minWidth: 80,
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () =>
+          inv_type_list.find(item => item.value == row.inv_type + "")?.label ||
+          "--"
+      });
+    }
+  },
   {
     label: "申请人",
     prop: "apply_name",

+ 4 - 34
src/views/InvoiceSales/invoiceApply/index.vue

@@ -1,6 +1,5 @@
 <script setup lang="ts">
 import { reactive, ref } from "vue";
-import { type PaginationProps } from "@pureadmin/table";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 import { statusList, inv_type_list } from "./status";
 import { useRouter } from "vue-router";
@@ -8,8 +7,7 @@ import IntervalTime from "/@/components/IntervalTime";
 import NoAuth from "/@/components/NoAuth/NoAuth.vue";
 import contentConfig from "./config/content.config";
 import { PageContent } from "/@/components/PageContent";
-import { httpList } from "/@/api/InvoiceSales/invoiceApply";
-import { useResponseHandle, usePermission } from "/@/hooks";
+import { usePermission } from "/@/hooks";
 
 defineOptions({
   name: "invoiceApply"
@@ -32,39 +30,11 @@ const form = reactive({ ...initform });
 
 const { push } = useRouter();
 const pageContentRef = ref<InstanceType<typeof PageContent>>(null);
-const responseHandle = useResponseHandle();
-const dataList = ref([]);
 const loading = ref(false);
 
-const pagination = reactive<PaginationProps>({
-  total: 0,
-  pageSize: 15,
-  currentPage: 1,
-  background: true
-});
-
-async function onSearch() {
-  if (loading.value) return;
-  loading.value = true;
-  const { code, data, message } = await httpList(form);
-  responseHandle({
-    code,
-    message,
-    handler: () => {
-      const { list, count } = data;
-      dataList.value = list ?? [];
-      pagination.total = count ?? 0;
-      pagination.pageSize = form.size;
-      pagination.currentPage = form.page;
-    }
-  });
-
-  loading.value = false;
-}
 async function resetSearch() {
   form.page = 1;
-  // await onSearch();
-  // pageContentRef.getP
+  (pageContentRef.value as any).getPageData(form);
 }
 //新建/详情页面
 const toDetail = (id?: string) => {
@@ -80,7 +50,7 @@ async function resetForm() {
   Object.keys(form).forEach(key => {
     form[key] = initform[key];
   });
-  await onSearch();
+  (pageContentRef.value as any).getPageData(form);
 }
 const { permission, contentConfigRef } = usePermission({
   pageName: "invoiceApply",
@@ -169,7 +139,7 @@ const { permission, contentConfigRef } = usePermission({
             <el-button
               :icon="useRenderIcon('refresh')"
               class="fl"
-              @click="resetForm()"
+              @click="resetForm"
             >
               重置
             </el-button>

+ 15 - 0
src/views/InvoiceSales/refund/config/content.config.ts

@@ -5,6 +5,7 @@ import dayjs from "dayjs";
 import { ElTag, ElImage } from "element-plus";
 import { h } from "vue";
 import { RETRUN_STATUS } from "/@/utils/details/refund";
+import { refund_type } from "./search.config";
 
 const columns = [
   {
@@ -46,10 +47,24 @@ const columns = [
     label: "退款原因",
     prop: "return_reason"
   },
+  {
+    label: "申请人id",
+    prop: "apply_id"
+  },
   {
     label: "申请人",
     prop: "apply_name"
   },
+  {
+    label: "退款类型",
+    prop: "status",
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () =>
+          refund_type.find(s => s.value === row.type)?.label || "--"
+      });
+    }
+  },
   {
     label: "状态",
     prop: "status",

+ 38 - 3
src/views/InvoiceSales/refund/config/search.config.ts

@@ -1,5 +1,30 @@
 import { FormConfig } from "/@/components/PageSearch";
-import { RETURN_STATUS, RETURN_TYPE } from "/@/utils/details/inv-return";
+
+export const refund_type = [
+  {
+    value: "1",
+    label: "退款"
+  },
+  {
+    value: "2",
+    label: "资金认领解除"
+  }
+];
+
+export const refund_status = [
+  {
+    value: "0",
+    label: "待审核"
+  },
+  {
+    value: "1",
+    label: "财务审核"
+  },
+  {
+    value: "2",
+    label: "财务驳回"
+  }
+];
 
 const searchFormConfig: FormConfig = {
   formItems: [
@@ -18,17 +43,27 @@ const searchFormConfig: FormConfig = {
       type: "input",
       placeholder: "退款编号"
     },
+    {
+      field: "apply_id",
+      type: "input",
+      placeholder: "申请人id"
+    },
+    {
+      field: "apply_name",
+      type: "input",
+      placeholder: "申请人名称"
+    },
     {
       field: "type",
       type: "select",
       placeholder: "退款类型",
-      options: RETURN_TYPE
+      options: refund_type
     },
     {
       field: "status",
       type: "select",
       placeholder: "退款状态",
-      options: RETURN_STATUS
+      options: refund_status
     }
   ]
 };

+ 1 - 1
src/views/InvoiceSales/sheetOrderPool/config/content.config.ts

@@ -169,7 +169,7 @@ const columns = [
     cellRenderer: ({ row }) =>
       h(ElTag, null, {
         default: () =>
-          cat_status.find(s => s.value === row.qrdType)?.label || "--"
+          cat_status.find(s => s.value === row.cat_status)?.label || "--"
       })
   },
   {

+ 4 - 3
src/views/InvoiceSales/sheetOrderPool/config/search.config.ts

@@ -105,11 +105,11 @@ export const seend_type = [
 
 export const cat_status = [
   {
-    value: "1",
+    value: "0",
     label: "未设置"
   },
   {
-    value: "2",
+    value: "1",
     label: "已设置"
   }
 ];
@@ -224,7 +224,8 @@ const searchFormConfig: FormConfig = {
     {
       field: "cat_status",
       type: "select",
-      placeholder: "是否设置类目"
+      placeholder: "是否设置类目",
+      options: cat_status
     },
     {
       field: "status",