Browse Source

fix:采购单列表字段显示/类型

snow 2 năm trước cách đây
mục cha
commit
3620dc54cc

+ 3 - 3
src/components/BasicForm/src/configs/config.ts

@@ -33,7 +33,7 @@ export const CONTACT_OPTIONS = [
     rule: {
       ...basic,
       validator(_, value) {
-        return iszf(value);
+        return iszf(value || "");
       }
     }
   },
@@ -43,7 +43,7 @@ export const CONTACT_OPTIONS = [
     rule: {
       ...basic,
       validator(_, value) {
-        return isz(value);
+        return isz(value || "");
       }
     }
   },
@@ -53,7 +53,7 @@ export const CONTACT_OPTIONS = [
     rule: {
       ...basic,
       validator(_, value) {
-        return isMobile(value);
+        return isMobile(value || "");
       }
     }
   }

+ 13 - 2
src/components/BasicForm/src/form-items.vue

@@ -13,9 +13,10 @@ const props = defineProps(basicFormProps);
 const formData = useVModel(props, "formData");
 
 onMounted(() => {
-  if (!props.contact) return;
-
   const data = formData.value[props.contact];
+
+  if (!props.contact || !data) return;
+
   contact.value =
     CONTACT_OPTIONS.find(c => c.rule.validator("", data))?.value || "4";
 });
@@ -43,6 +44,16 @@ onMounted(() => {
           />
         </template>
 
+        <!-- 数字输入 -->
+        <template v-if="item.type === 'number'">
+          <el-input-number
+            v-model="formData[item.field]"
+            :placeholder="item.placeholder"
+            v-bind="INPUT_MAX_LENGTH"
+            clearable
+          />
+        </template>
+
         <!-- 选择框 -->
         <template v-if="item.type === 'select'">
           <el-select

+ 2 - 1
src/components/BasicForm/src/types.ts

@@ -10,7 +10,8 @@ export type FormItemType =
   | "img_upload"
   | "date_picker"
   | "range"
-  | "contact";
+  | "contact"
+  | "number";
 
 export type FormItem = {
   field: string;

+ 3 - 1
src/components/PageModal/src/page-modal.vue

@@ -31,7 +31,9 @@ function changeDefaultInfo(formItems: Array<FormItem>, newVal: any) {
     const isCheckBox = item.type === "checkbox";
 
     formData.value[item.field] = isCheckBox
-      ? newVal[item.field].split(",")
+      ? newVal[item.field]
+        ? newVal[item.field].split(",")
+        : []
       : newVal[item.field];
   }
 }

+ 1 - 1
src/utils/status.ts

@@ -16,7 +16,7 @@ const levelList = [
   { value: "2", label: "专员", type: "warning" }
 ];
 const cg_order_type_options = [
-  { value: "1", label: "备库单" },
+  { value: "1", label: "库存品" },
   { value: "2", label: "非库存品" },
   { value: "3", label: "采反" }
 ];

+ 8 - 12
src/views/parameter/finance/config/form-items/modal.ts

@@ -1,4 +1,5 @@
 import { FormItem } from "/@/components/BasicForm";
+import { isLicense } from "/@/utils/validate";
 
 export const companyItems: Array<FormItem> = [
   {
@@ -45,9 +46,11 @@ export const companyItems: Array<FormItem> = [
     placeholder: "企业纳税号",
     rules: [
       {
+        validator(_, value) {
+          return isLicense(value);
+        },
         required: true,
-        trigger: "change",
-        message: "请输入企业纳税号"
+        message: "纳税人识别号格式不正确"
       }
     ]
   },
@@ -81,17 +84,10 @@ export const companyItems: Array<FormItem> = [
   },
   {
     field: "mobile",
-    type: "input",
+    type: "contact",
     labelWidth: "120px",
     label: "企业联系方式",
-    placeholder: "企业联系方式",
-    rules: [
-      {
-        required: true,
-        trigger: "change",
-        message: "请输入企业联系方式"
-      }
-    ]
+    placeholder: "企业联系方式"
   }
 ];
 
@@ -218,7 +214,7 @@ export const outItems: Array<FormItem> = [
   },
   {
     field: "denomination",
-    type: "input",
+    type: "number",
     labelWidth: "120px",
     label: "面额",
     placeholder: "面额",

+ 1 - 0
src/views/parameter/finance/config/modal.config.ts

@@ -3,6 +3,7 @@ import { ModalConfig } from "/@/components/PageModal/src/types";
 
 const modalConfig: ModalConfig = {
   title: "业务公司发票",
+  contact: "mobile",
   colLayout: {
     xl: 12,
     lg: 12,

+ 60 - 25
src/views/purchase/porder/columns.tsx

@@ -1,8 +1,21 @@
 import { ref } from "vue";
-import {
-  cg_order_type_options,
-  cg_order_source_options
-} from "/@/utils/status";
+import { cg_order_source_options } from "/@/utils/status";
+
+const good_type = [
+  {
+    value: "1",
+    label: "正常商品"
+  },
+  {
+    value: "2",
+    label: "赠品"
+  },
+  {
+    value: "3",
+    label: "样品"
+  }
+];
+
 export function useColumns() {
   const columns = ref([
     {
@@ -19,32 +32,58 @@ export function useColumns() {
 
     {
       label: "采购单编号",
-      prop: "sequenceNo"
+      prop: "sequenceNo",
+      width: "120px"
     },
     {
-      label: "商品编号",
-      prop: "goodNo"
+      label: "商品单号",
+      prop: "goodNo",
+      width: "120px"
     },
     {
       label: "商品名称",
-      prop: "goodName"
+      prop: "goodName",
+      width: "120px"
+    },
+    {
+      label: "业务公司编号",
+      prop: "companyNo",
+      width: "120px"
+    },
+    {
+      label: "业务公司名称",
+      prop: "companyNo",
+      width: "120px"
     },
-
-    // {
-    //   label: "业务公司编号",
-    //   prop: "companyNo"
-    // },
-    // {
-    //   label: "业务公司名称",
-    //   prop: "companyName"
-    // },
     {
       label: "供应商编号",
-      prop: "supplierNo"
+      prop: "supplierNo",
+      width: "120px"
     },
     {
       label: "供应商名称",
-      prop: "supplierName"
+      prop: "supplierName",
+      width: "120px"
+    },
+    {
+      label: "备库编号",
+      prop: "bkCode",
+      width: "120px"
+    },
+    {
+      label: "确认单编号",
+      width: "120px",
+      prop: "goodNo"
+    },
+    {
+      label: "状态",
+      prop: "cgdType",
+      width: 95,
+      cellRenderer: ({ row, props }) => (
+        <el-tag size={props.size} type="" effect="plain">
+          {row.status === "0" ? "未对账" : "对账"}
+        </el-tag>
+      )
     },
     {
       label: "订单来源",
@@ -66,15 +105,11 @@ export function useColumns() {
       width: 95,
       cellRenderer: ({ row, props }) => (
         <el-tag size={props.size} type="" effect="plain">
-          {(
-            cg_order_type_options.find(
-              item => item.value == row.cgdType + ""
-            ) || {}
-          ).label || "--"}
+          {(good_type.find(item => item.value == row.cgdType + "") || {})
+            .label || "--"}
         </el-tag>
       )
     },
-
     {
       label: "采购员",
       prop: "ownerName",

+ 0 - 2
src/views/purchase/porder/index.vue

@@ -117,8 +117,6 @@ const resetForm = (formEl: FormInstance | undefined) => {
 
 onMounted(() => {
   powers.value = useUserStoreHook().getMenuActions("porder");
-  // console.log("8888888888888888");
-  // console.log(powers.value);
   if (powers.value.some(i => i == "001")) {
     onSearch();
   }