hurx 3 周之前
父節點
當前提交
632f85e165

+ 5 - 3
src/views/customer/customerFile/customerInfo/overview/orgStructure.vue

@@ -369,11 +369,13 @@ const toggleExpandAll = (data: CustomerDeptVO[], status: boolean) => {
 /** 修改按钮操作 */
 const handleUpdate = async (row: CustomerDeptVO) => {
   const res = await getCustomerDept(row.deptId);
-  Object.assign(form.value, res.data);
   // 修正数据:如果 parentId 等于自己的 id,说明是顶级部门,将 parentId 设为 0
-  if (form.value.parentId === form.value.deptId) {
-    form.value.parentId = 0;
+
+  if (res.data.parentId === 100) {
+    res.data.parentId = undefined;
   }
+  Object.assign(form.value, res.data);
+
   dialog.visible = true;
   dialog.title = '修改部门';
 };

+ 5 - 1
src/views/order/orderMain/components/addressDialog.vue

@@ -72,7 +72,11 @@ const form = ref<ShippingAddressForm>({ ...initForm });
 
 const rules: FormRules = {
   consignee: [{ required: true, message: '收货人姓名不能为空', trigger: 'blur' }],
-  provincialCityCountry: [{ required: true, message: '详细地址不能为空', trigger: 'blur' }]
+  provincialCityCountry: [{ required: true, message: '详细地址不能为空', trigger: 'blur' }],
+  phone: [
+    { required: true, message: '收货人手机号不能为空', trigger: 'blur' },
+    { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
+  ]
 };
 
 // 监听 modelValue 变化