Переглянути джерело

change: 企业微信申请货物直发.迭代1.

(cherry picked from commit 75ce1e343776ad9395c74607deb78219fa79744a)
peter 7 місяців тому
батько
коміт
eb7ea2448e
1 змінених файлів з 67 додано та 35 видалено
  1. 67 35
      src/pages/wecom-approval/index.vue

+ 67 - 35
src/pages/wecom-approval/index.vue

@@ -316,6 +316,14 @@
               >
                 Reset
               </el-button>
+              <el-button
+                style="margin: 8px 0 0 0"
+                type="primary"
+                size="small"
+                @click="autoFillNumber"
+              >
+                Dispatch All
+              </el-button>
             </div>
           </template>
           <el-table :data="form.goods">
@@ -475,7 +483,7 @@ const form = ref({
   price: [{ pa: '', pb: '' }],
   goods: [] as any[],
   files: [] as { file_id: string; name: string }[], // 附件
-  useField: ''
+  useField: '',
 })
 const rules = ref<FormRules>({
   creator_userid: [{ required: true, message: '必填项', trigger: 'blur' }],
@@ -675,6 +683,15 @@ const huodaiList = [
       },
     ],
   },
+  {
+    key: 'option-1723103324115',
+    value: [
+      {
+        text: '其他货代(请与物流部沟通)',
+        lang: 'zh_CN',
+      },
+    ],
+  },
 ]
 
 const transList = [
@@ -763,6 +780,13 @@ const resetGoods = function () {
     form.value.goods = []
   }
 }
+
+const autoFillNumber = function () {
+  form.value.goods.forEach((i) => {
+    i.number = i.quantity
+  })
+}
+
 const firstName = ref('')
 request
   .post('/common/getSalesOrdersData', {
@@ -1080,43 +1104,45 @@ const submit = function () {
       control: 'Table',
       id: 'Table-1718950612643',
       value: {
-        children: form.value.goods.map((g) => {
-          if (g.number > g.quantity) {
-            setTimeout(() => {
-              ElNotification({
-                duration: 0,
-                type: 'warning',
-                title: '注意',
-                message: `${g.name} 发货数量${g.number}大于可发货数量${g.quantity}`,
-              })
-            }, 0)
-          }
-          return {
-            list: [
-              {
-                control: 'Text',
-                id: 'Text-1718950641228',
-                value: {
-                  text: g.name,
+        children: form.value.goods
+          .filter((g) => g.number > 0)
+          .map((g) => {
+            if (g.number > g.quantity) {
+              setTimeout(() => {
+                ElNotification({
+                  duration: 0,
+                  type: 'warning',
+                  title: '注意',
+                  message: `${g.name} 发货数量${g.number}大于可发货数量${g.quantity}`,
+                })
+              }, 0)
+            }
+            return {
+              list: [
+                {
+                  control: 'Text',
+                  id: 'Text-1718950641228',
+                  value: {
+                    text: g.name,
+                  },
                 },
-              },
-              {
-                control: 'Textarea',
-                id: 'Textarea-1718950654801',
-                value: {
-                  text: g.desc,
+                {
+                  control: 'Textarea',
+                  id: 'Textarea-1718950654801',
+                  value: {
+                    text: g.desc,
+                  },
                 },
-              },
-              {
-                control: 'Number',
-                id: 'Number-1718950666260',
-                value: {
-                  new_number: g.number,
+                {
+                  control: 'Number',
+                  id: 'Number-1718950666260',
+                  value: {
+                    new_number: g.number,
+                  },
                 },
-              },
-            ],
-          }
-        }),
+              ],
+            }
+          }),
       },
     })
   }
@@ -1227,6 +1253,12 @@ input[type='number'] {
   right: 16px;
 }
 .addr-input-group {
+  ::v-deep {
+    input,
+    textarea {
+      text-align: right;
+    }
+  }
   .el-input,
   .el-textarea {
     margin-bottom: 10px;