ezhizao_zx 11 meses atrás
pai
commit
55da9c9a86
1 arquivos alterados com 14 adições e 4 exclusões
  1. 14 4
      src/views/business/dialog/CarrierChoiceDialog.vue

+ 14 - 4
src/views/business/dialog/CarrierChoiceDialog.vue

@@ -15,7 +15,7 @@
         <el-form-item label="产品描述:" prop="productDescription" :rules="rules">
           {{ form.productDescription }}
         </el-form-item>
-        <el-form-item label="箱号:" prop="parentId" :rules="rules">
+        <el-form-item label="箱号:" prop="carrierIds">
           <el-select v-model="form.carrierIds" multiple filterable remote reserve-keyword placeholder="请选择箱号"
             :remote-method="(arg) => remoteCarriers(arg, form.newCarriers, form)" :loading="loadingCarrier"
             @change="(arg) => handleCarrierChange(arg, form)">
@@ -46,7 +46,9 @@ const loadingCarrier = ref(false)
 const visible = ref(false);
 const carriers = ref([])
 const data = reactive({
-  form: {}
+  form: {},
+  rules: {
+  }
 });
 const { form, rules } = toRefs(data);
 
@@ -72,8 +74,17 @@ function reset() {
   proxy.resetForm("categoryRef");
 }
 
+function carrierValidator(rules, value) {
+  console.log(rules)
+  console.log(value)
+}
+
 /** 提交按钮 */
 function handleSave() {
+  if (form.value.carrierIds == null || form.value.carrierIds.length === 0) {
+    proxy.$modal.msgError("箱号不能为空");
+    return
+  }
   proxy.$refs["categoryRef"].validate((valid) => {
     if (valid) {
       saveCarriers(form.value).then((res) => {
@@ -100,7 +111,6 @@ function remoteCarriers(code, newCarrier, row) {
     return;
   }
   carrierForOutsource({
-    categoryId: categoryId,
     code: code,
     dayworkId: row.dayworkId
   }).then((res) => {
@@ -127,7 +137,7 @@ function handleCarrierChange(arg, item) {
   item.newCarriers = item.carriers
     .filter((v) => arg.includes(v.value))
     .map((v) => ({ id: v.value, code: v.label }));
-  console.log(item.newCarriers);
+  // console.log(item.newCarriers);
   item.carrierNum = item.newCarriers.length;
 }