Browse Source

邮件发件功能,维多利亚bug解决

cz 2 years ago
parent
commit
e2deafa55c

+ 1 - 0
src/assets/images/icon_attachment.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1664269048168" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7373" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M386.304 896.384a283.712 283.712 0 0 1-200.768-484.416l269.376-269.376a51.2 51.2 0 0 1 72.384 72.384L257.92 484.352a181.44 181.44 0 0 0 256.64 256.64l289.6-289.664a51.2 51.2 0 1 1 72.384 72.384l-289.6 289.664a282.816 282.816 0 0 1-200.64 83.008z" p-id="7374" fill="#0084FF"></path><path d="M605.568 773.824a51.2 51.2 0 0 1-36.224-87.424l219.328-219.392a104.064 104.064 0 0 0 0-147.2 106.496 106.496 0 0 0-147.2 0L422.144 539.136a51.2 51.2 0 0 1-72.384-72.384l219.328-219.328a206.272 206.272 0 1 1 291.712 291.712l-219.328 219.392a51.2 51.2 0 0 1-35.904 15.296z" p-id="7375" fill="#0084FF"></path><path d="M406.784 720.768a128.704 128.704 0 0 1-91.008-219.776l268.8-268.8a51.2 51.2 0 1 1 72.384 72.384l-268.8 268.8a26.24 26.24 0 0 0 0 37.248 26.432 26.432 0 0 0 37.312 0l245.888-245.888a51.2 51.2 0 0 1 72.384 72.384l-245.888 246.016a128.512 128.512 0 0 1-91.072 37.632z" p-id="7376" fill="#0084FF"></path></svg>

+ 1 - 0
src/assets/images/icon_delete.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1664261610831" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4986" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M448 181.9648h128a38.4 38.4 0 0 0 0-76.8h-128a38.4 38.4 0 0 0 0 76.8zM870.4 203.0592H153.6a51.2 51.2 0 0 0 0 102.4h51.2v510.9248a102.4 102.4 0 0 0 102.4 102.4h409.6a102.4 102.4 0 0 0 102.4-102.4V305.4592h51.2a51.2 51.2 0 0 0 0-102.4zM471.4496 765.184a51.2 51.2 0 0 1-102.4 0v-307.2a51.2 51.2 0 0 1 102.4 0z m183.5008 0a51.2 51.2 0 0 1-102.4 0v-307.2a51.2 51.2 0 0 1 102.4 0z" p-id="4987" fill="#999999"></path></svg>

+ 1 - 0
src/assets/images/icon_dz.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1664351723466" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4226" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M941.184 172.8L786.752 18.624a64 64 0 0 0-45.248-18.688H192a128 128 0 0 0-128 128V896a128 128 0 0 0 128 128h640a128 128 0 0 0 128-128V218.176a64 64 0 0 0-18.816-45.376zM304 377.6h264a48 48 0 0 1 0 96H304a48 48 0 0 1 0-96z m416 322.688h-416a48 48 0 0 1 0-96h416a48 48 0 0 1 0 96z m69.312-443.392a64 64 0 0 1-64-64v-128l192 192z" p-id="4227" fill="#F94539"></path></svg>

+ 1 - 0
src/components/WDLY/process/ReturnGood.vue

@@ -198,6 +198,7 @@ const pushGoods = (goods) => {
   }));
   formData.data.salesReturnDetailList =
     formData.data.salesReturnDetailList.concat(arr);
+  openProduct.value = false;
   return ElMessage({
     message: "添加成功!",
     type: "success",

+ 14 - 6
src/components/WDLY/process/SendPurchaseWDLY.vue

@@ -316,6 +316,7 @@ const pushGoods = (goods) => {
   }));
   formData.data.purchaseDetailList =
     formData.data.purchaseDetailList.concat(arr);
+  openProduct.value = false;
   return ElMessage({
     message: "添加成功!",
     type: "success",
@@ -431,12 +432,19 @@ const handleChangeSupplier = (val) => {
       productIdList: ids,
     })
     .then((res) => {
-      for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
-        const e = formData.data.purchaseDetailList[i];
-        for (const key in res) {
-          if (e.bussinessId === key) {
-            e.price = Number(res[key]);
-          } else e.price = null;
+      if (Object.keys(res).length > 0) {
+        for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
+          const e = formData.data.purchaseDetailList[i];
+          for (const key in res) {
+            if (e.bussinessId === key) {
+              e.price = Number(res[key]);
+            } else e.price = null;
+          }
+        }
+      } else {
+        for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
+          const e = formData.data.purchaseDetailList[i];
+          e.price = 0;
         }
       }
       handleChangeAmount();

+ 1 - 0
src/components/WDLY/process/SendSubscribeWDLY.vue

@@ -223,6 +223,7 @@ const pushGoods = (goods) => {
   }));
   formData.data.subscribeDetailList =
     formData.data.subscribeDetailList.concat(arr);
+  openProduct.value = false;
   return ElMessage({
     message: "添加成功!",
     type: "success",

+ 4 - 2
src/components/WDLY/product/SelectGoods.vue

@@ -30,8 +30,10 @@
         >
       </div>
       <div style="text-align: center">
-        <el-button @click="handleCancel">取消</el-button>
-        <el-button type="primary" @click="handleSubmit"> 确 定 </el-button>
+        <el-button @click="handleCancel" size="large">取消</el-button>
+        <el-button type="primary" @click="handleSubmit" size="large">
+          确 定
+        </el-button>
       </div>
     </div>
   </div>

+ 1 - 0
src/components/WDLY/product/SelectProduct.vue

@@ -779,6 +779,7 @@ const pushGoods = (goods) => {
   }));
   formData.data.productCombinationList =
     formData.data.productCombinationList.concat(arr);
+  openProduct.value = false;
   return ElMessage({
     message: "添加成功!",
     type: "success",

+ 1 - 0
src/components/process/ReturnGood.vue

@@ -198,6 +198,7 @@ const pushGoods = (goods) => {
   }));
   formData.data.salesReturnDetailList =
     formData.data.salesReturnDetailList.concat(arr);
+  openProduct.value = false;
   return ElMessage({
     message: "添加成功!",
     type: "success",

+ 10 - 4
src/components/process/SendPurchase.vue

@@ -144,7 +144,12 @@
         </el-col>
       </el-row>
     </el-form>
-    <el-dialog v-model="openProduct" title="选择货品" width="70%" append-to-body>
+    <el-dialog
+      v-model="openProduct"
+      title="选择货品"
+      width="70%"
+      append-to-body
+    >
       <SelectGoods
         @cancel="openProduct = false"
         @pushGoods="pushGoods"
@@ -205,6 +210,7 @@ const pushGoods = (goods) => {
   }));
   formData.data.purchaseDetailList =
     formData.data.purchaseDetailList.concat(arr);
+  openProduct.value = false;
   return ElMessage({
     message: "添加成功!",
     type: "success",
@@ -277,10 +283,10 @@ const props = defineProps({
 
 const ids = ref([]);
 const getDetails = () => {
-  if (props.queryData.type && props.queryData.type === 'handoverSlip') {
+  if (props.queryData.type && props.queryData.type === "handoverSlip") {
     proxy.post("/contractProduct/getListDetail", ids.value).then((res) => {
       formData.data.purchaseDetailList = res.map((x) => {
-        delete x.id
+        delete x.id;
         return {
           ...x,
           subscribeCount: x.sumPackQuantity,
@@ -288,7 +294,7 @@ const getDetails = () => {
           count: 0,
           price: null,
           amount: null,
-        }
+        };
       });
     });
   } else {

+ 1 - 0
src/components/process/SendSubscribe.vue

@@ -155,6 +155,7 @@ const pushGoods = (goods) => {
   }));
   formData.data.subscribeDetailList =
     formData.data.subscribeDetailList.concat(arr);
+  openProduct.value = false;
   return ElMessage({
     message: "添加成功!",
     type: "success",

+ 4 - 2
src/components/product/SelectGoods.vue

@@ -30,8 +30,10 @@
         >
       </div>
       <div style="text-align: center">
-        <el-button @click="handleCancel">取消</el-button>
-        <el-button type="primary" @click="handleSubmit"> 确 定 </el-button>
+        <el-button @click="handleCancel" size="large">取消</el-button>
+        <el-button type="primary" @click="handleSubmit" size="large">
+          确 定
+        </el-button>
       </div>
     </div>
   </div>

+ 47 - 11
src/views/WDLY/basic/product/index.vue

@@ -117,7 +117,13 @@
                     :rules="rules.linkQuantity"
                     :inline-message="true"
                   >
-                    <el-input v-model="row.linkQuantity" placeholder="请输入" />
+                    <el-input-number
+                      v-model="row.linkQuantity"
+                      placeholder="请输入"
+                      :min="1"
+                      :controls="false"
+                      :precision="0"
+                    />
                   </el-form-item>
                 </template>
               </el-table-column>
@@ -146,20 +152,28 @@
               </el-col>
               <el-col :span="1" style="text-align: center"> ~ </el-col>
               <el-col :span="4">
-                <el-input
+                <el-input-number
                   v-model="formData.data.victoriatouristJson.newProductsDay"
                   placeholder="请输入"
+                  :min="0"
+                  :controls="false"
+                  :precision="0"
+                  style="width: 100%"
                   @change="changeDay(10)"
                 >
-                </el-input>
+                </el-input-number>
               </el-col>
               <el-col :span="1" style="text-align: center"> : </el-col>
               <el-col :span="6">
-                <el-input
+                <el-input-number
                   v-model="
                     formData.data.victoriatouristJson.newProductsExpectedSales
                   "
                   placeholder="预期销量"
+                  :min="0"
+                  :controls="false"
+                  :precision="0"
+                  style="width: 100%"
                 />
               </el-col>
             </el-row>
@@ -177,20 +191,28 @@
               </el-col>
               <el-col :span="1" style="text-align: center"> ~ </el-col>
               <el-col :span="4">
-                <el-input
+                <el-input-number
                   v-model="formData.data.victoriatouristJson.growUpDay"
                   placeholder="请输入"
+                  :min="0"
+                  :controls="false"
+                  :precision="0"
+                  style="width: 100%"
                   @change="changeDay(20)"
                 >
-                </el-input>
+                </el-input-number>
               </el-col>
               <el-col :span="1" style="text-align: center"> : </el-col>
               <el-col :span="6">
-                <el-input
+                <el-input-number
                   v-model="
                     formData.data.victoriatouristJson.growUpExpectedSales
                   "
                   placeholder="预期销量"
+                  :min="0"
+                  :controls="false"
+                  :precision="0"
+                  style="width: 100%"
                 />
               </el-col>
             </el-row>
@@ -202,9 +224,13 @@
               大于{{ formData.data.victoriatouristJson.attDay }}天:
             </el-col>
             <el-col :span="6">
-              <el-input
+              <el-input-number
                 v-model="formData.data.victoriatouristJson.matureExpectedSales"
                 placeholder="预期销量"
+                :min="0"
+                :controls="false"
+                :precision="0"
+                style="width: 100%"
               />
             </el-col>
           </el-row>
@@ -584,27 +610,37 @@ const formConfig = computed(() => {
       prop: "victoriatouristJson",
       json: [
         {
-          type: "input",
+          type: "number",
           prop: "jdPurchasePrice",
           label: "京东供价",
           itemWidth: 33,
+          precision: 2,
+          min: 0,
+          controls: false,
           style: {
             width: "100%",
             "margin-right": "10px",
           },
         },
         {
-          type: "input",
+          type: "number",
           prop: "sellingPrice",
           label: "标准售价",
           itemWidth: 33,
+          precision: 2,
+          min: 0,
+          controls: false,
         },
         {
-          type: "input",
+          type: "number",
           prop: "purchasePrice",
           label: "标准采购价",
           itemWidth: 33,
+          precision: 2,
+          min: 0,
+          controls: false,
         },
+
         {
           type: "date",
           prop: "clearancePeriod",

+ 102 - 93
src/views/WDLY/outInBound/waitOutBound/index.vue

@@ -24,9 +24,8 @@
     <el-dialog
       title="出库"
       v-model="dialogVisible"
-      width="800"
-      v-loading="submitLoading"
-      destroy-on-close
+      width="500"
+      v-loading="loading"
     >
       <byForm
         :formConfig="formConfig"
@@ -37,28 +36,50 @@
       >
         <template #products>
           <div style="width: 100%">
-            <!-- <el-button
+            <el-button
               type="primary"
               @click="clickAdd()"
               style="margin-bottom: 10px"
               v-if="modalType == 'add'"
             >
               添加物品
-            </el-button> -->
-            <el-table :data="formData.data.jdOrderDetailsList">
+            </el-button>
+            <el-table :data="formData.data.stockTransferDetailsList">
               <el-table-column prop="productCode" label="物品编码" />
               <el-table-column prop="productName" label="物品名称" />
               <el-table-column prop="productSpec" label="规格型号" />
-              <el-table-column prop="waitQuantity" label="待出库数量" />
-              <el-table-column prop="quantity" label="调仓数量" min-width="150">
+              <el-table-column
+                prop="outQuantity"
+                label="调仓数量"
+                v-if="modalType == 'detail'"
+              />
+              <el-table-column
+                prop="inQuantity"
+                label="接收数量"
+                v-if="modalType == 'detail'"
+              />
+
+              <el-table-column
+                prop="outQuantity"
+                label="调仓数量"
+                v-if="modalType == 'edit'"
+              />
+              <el-table-column
+                prop="outQuantity"
+                label="调仓数量"
+                min-width="150"
+                v-if="modalType == 'add'"
+              >
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'jdOrderDetailsList.' + $index + '.quantity'"
-                    :rules="rules.quantity"
+                    :prop="
+                      'stockTransferDetailsList.' + $index + '.outQuantity'
+                    "
+                    :rules="rules.outQuantity"
                     :inline-message="true"
                   >
                     <el-input-number
-                      v-model="row.quantity"
+                      v-model="row.outQuantity"
                       :precision="2"
                       :controls="false"
                       :min="0"
@@ -74,7 +95,7 @@
               >
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'jdOrderDetailsList.' + $index + '.inQuantity'"
+                    :prop="'stockTransferDetailsList.' + $index + '.inQuantity'"
                     :rules="rules.inQuantity"
                     :inline-message="true"
                   >
@@ -166,24 +187,18 @@ let rules = ref({
   warehouseId: [
     { required: true, message: "请选择仓库名称", trigger: "change" },
   ],
-  outWarehouseId: [
-    { required: true, message: "请选择调出仓库", trigger: "change" },
-  ],
-  inWarehouseId: [
-    { required: true, message: "请选择调入仓库", trigger: "change" },
-  ],
-  quantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
+  quantity: [{ required: true, message: "请输入入库数量", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
     label: "数据来源",
-    prop: "businessType",
+    prop: "type",
     data: [],
   },
   {
     label: "出库状态",
-    prop: "status",
+    prop: "type",
     data: [],
   },
 ]);
@@ -267,7 +282,7 @@ const config = computed(() => {
         prop: "status",
       },
       render(status) {
-        return status == 0 ? "未出库" : status == 1 ? "部分出库" : "入库完成";
+        return status == 0 ? "未出库" : status == 1 ? "部分出库" : "";
       },
     },
     {
@@ -279,20 +294,18 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          row.status < 2
-            ? {
-                attrs: {
-                  label: "出库",
-                  type: "primary",
-                  text: true,
-                  disabled: row.status > 1,
-                },
-                el: "button",
-                click() {
-                  outBound(row);
-                },
-              }
-            : {},
+          {
+            attrs: {
+              label: "出库",
+              type: "primary",
+              text: true,
+              disabled: row.status > 1,
+            },
+            el: "button",
+            click() {
+              outBound(row);
+            },
+          },
         ];
       },
     },
@@ -440,66 +453,62 @@ const openModal = () => {
 
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
-    if (modalType.value === "add") {
-      const list = formData.data.jdOrderDetailsList;
-      for (let i = 0; i < list.length; i++) {
-        const e = list[i];
-        if (!(e.quantity > 0)) {
-          return ElMessage({
-            message: "调仓数量不能为0!",
-            type: "info",
-          });
-        }
-        if (e.quantity > e.waitQuantity) {
-          return ElMessage({
-            message: "调仓数量不能大于待出库数量!",
-            type: "info",
-          });
-        }
+    const list = formData.data.stockWaitDetailsList;
+    const total = list.reduce((total, x) => (total += Number(x.quantity)), 0);
+    if (!(total > 0)) {
+      return ElMessage({
+        message: `本次入库不能为0!`,
+        type: "info",
+      });
+    }
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      if (Number(e.receiptQuantity) + e.quantity > Number(e.arrivalQuantity)) {
+        return ElMessage({
+          message: "本次入库加已入库数量不可大于发货数量!",
+          type: "info",
+        });
       }
-      submitLoading.value = true;
-      proxy.post("/jdOrder/outbound", formData.data).then(
-        (res) => {
-          ElMessage({
-            message: "操作成功",
-            type: "success",
-          });
-          dialogVisible.value = false;
-          submitLoading.value = false;
-          getList();
-        },
-        (err) => (submitLoading.value = false)
-      );
     }
+    submitLoading.value = true;
+    proxy.post("/stockWait/addByWdly", formData.data).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
   });
 };
 
 const outBound = (row) => {
-  if (row.businessType == 5) {
-    modalType.value = "add";
-    formConfig.value = configData[1];
-    proxy.post("/jdOrder/detail", { id: row.businessId }).then((res) => {
-      formData.data = {
-        id: row.businessId,
-        outWarehouseId: "",
-        inWarehouseId: "",
-        jdOrderDetailsList: res.jdOrderDetailsList.map((x) => ({
-          waitQuantity: row.quantity,
-          quantity: row.quantity,
-          productId: x.productId,
-          id: x.id,
-          productCode: x.productCode,
-          productName: x.productName,
-          productSpec: x.productSpec,
-        })),
-      };
-      dialogVisible.value = true;
-    });
-  } else {
-    modalType.value = "edit";
+  const index = row.$index;
+  modalType.value = "add";
+  if (index % 2 == 0) {
     formConfig.value = configData[0];
+  } else {
+    formConfig.value = configData[1];
   }
-
+  // proxy.post("/stockWait/detailByWdly", { id: row.id }).then((res) => {
+  //   const json = JSON.parse(res.victoriatouristJson);
+  //   formData.data = {
+  //     type: "1",
+  //     businessType: res.businessType,
+  //     warehouseId: "",
+  //     code: json.code,
+  //     stockWaitDetailsList: res.stockWaitDetailsList.map((x) => ({
+  //       ...x,
+  //       arrivalQuantity: x.quantity,
+  //       quantity: 0,
+  //     })),
+  //   };
+  //   dialogVisible.value = true;
+  // });
   dialogVisible.value = true;
 };
 const warehouseType = ref([]);
@@ -510,7 +519,7 @@ const businessType = [
 ];
 
 const handleRemove = (index) => {
-  formData.data.jdOrderDetailsList.splice(index, 1);
+  formData.data.stockTransferDetailsList.splice(index, 1);
   return ElMessage({
     message: "删除成功",
     type: "success",
@@ -527,17 +536,17 @@ const clickAdd = () => {
 
 const select = (x) => {
   if (
-    formData.data.jdOrderDetailsList &&
-    formData.data.jdOrderDetailsList.length > 0
+    formData.data.stockTransferDetailsList &&
+    formData.data.stockTransferDetailsList.length > 0
   ) {
-    let data = formData.data.jdOrderDetailsList.filter(
+    let data = formData.data.stockTransferDetailsList.filter(
       (row) => row.bussinessId === x.productId
     );
     if (data && data.length > 0) {
       return ElMessage("请勿重复添加");
     }
   }
-  formData.data.jdOrderDetailsList.push({
+  formData.data.stockTransferDetailsList.push({
     goodType: x.goodType,
     productCode: x.productCode,
     productName: x.productName,

+ 3 - 2
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -28,7 +28,7 @@
     <el-dialog
       :title="modalType === 'add' ? '发货登记' : '到货通知'"
       v-model="dialogVisible"
-      width="800"
+      width="80%"
       v-loading="loading"
       destroy-on-close
     >
@@ -606,7 +606,8 @@ const handleArrival = (row, type) => {
           ...x,
           purchaseDetailId: x.id,
           alreadyDeliverGoodsQuantity: x.deliverGoodsQuantity,
-          deliverGoodsQuantity: 0,
+          deliverGoodsQuantity:
+            Number(x.count) - Number(x.deliverGoodsQuantity),
         })),
       };
       dialogVisible.value = true;

+ 2 - 2
src/views/WDLY/purchaseManage/purchase/index.vue

@@ -155,7 +155,7 @@ const sourceList = ref({
     total: 3,
     pageNum: 1,
     pageSize: 10,
-    status: "",
+    status: "15,30",
   },
 });
 let dialogVisible = ref(false);
@@ -263,7 +263,7 @@ const config = computed(() => {
         prop: "status",
       },
       render(status) {
-        return status == 15 ? "待采购" : "部分采购";
+        return status == 15 ? "待采购" : status == 20 ? "已采购" : "部分采购";
       },
     },
     {

+ 363 - 19
src/views/connect/E-mail/mail/com/mailWrite.vue

@@ -3,7 +3,7 @@
     <div style="margin-bottom: 10px; padding-left: 65px">
       <el-button type="primary" @click="handleSend">发送</el-button>
     </div>
-    <div style="width: 70%">
+    <div style="width: 100%">
       <byForm
         :formConfig="formConfig"
         :formOption="formOption"
@@ -11,7 +11,160 @@
         :rules="rules"
         ref="submit"
       >
-        <template #contentSlot> 内容插槽 </template>
+        <template #to>
+          <div>
+            <div style="display: flex">
+              <el-autocomplete
+                v-model="formData.data.to"
+                clearable
+                class="inline-input w-50"
+                placeholder="请输入"
+                @select="handlePerson"
+                :fetch-suggestions="querySearchPerson"
+              >
+              </el-autocomplete>
+              <el-button
+                type="primary"
+                @click="handleAdd(10)"
+                style="margin-left: 10px"
+                >添加</el-button
+              >
+            </div>
+            <div style="margin-top: 15px">
+              <el-tag
+                style="margin-right: 10px"
+                class="ml-2"
+                type="info"
+                v-for="(item, index) in to"
+                :key="index"
+                closable
+                @close="handleClose(index, 10)"
+                >{{ item.address }}</el-tag
+              >
+            </div>
+          </div>
+        </template>
+        <template #cc>
+          <div>
+            <div style="display: flex">
+              <el-autocomplete
+                v-model="formData.data.cc"
+                clearable
+                class="inline-input w-50"
+                placeholder="请输入"
+                @select="handlePerson"
+                :fetch-suggestions="querySearchPerson"
+              >
+              </el-autocomplete>
+              <el-button
+                type="primary"
+                @click="handleAdd(20)"
+                style="margin-left: 10px"
+                >添加</el-button
+              >
+            </div>
+            <div style="margin-top: 15px">
+              <el-tag
+                style="margin-right: 10px"
+                class="ml-2"
+                type="info"
+                v-for="(item, index) in cc"
+                :key="index"
+                closable
+                @close="handleClose(index, 20)"
+                >{{ item.address }}</el-tag
+              >
+            </div>
+          </div>
+        </template>
+        <template #bcc>
+          <div>
+            <div style="display: flex">
+              <el-autocomplete
+                v-model="formData.data.bcc"
+                clearable
+                class="inline-input w-50"
+                placeholder="请输入"
+                @select="handlePerson"
+                :fetch-suggestions="querySearchPerson"
+              >
+              </el-autocomplete>
+              <el-button
+                type="primary"
+                @click="handleAdd(30)"
+                style="margin-left: 10px"
+                >添加</el-button
+              >
+            </div>
+            <div style="margin-top: 15px">
+              <el-tag
+                style="margin-right: 10px"
+                class="ml-2"
+                type="info"
+                v-for="(item, index) in bcc"
+                :key="index"
+                closable
+                @close="handleClose(index, 30)"
+                >{{ item.address }}</el-tag
+              >
+            </div>
+          </div>
+        </template>
+
+        <template #contentSlot>
+          <div style="width: 100%">
+            <Editor
+              :value="formData.data.content"
+              @updateValue="updateContent"
+            />
+          </div>
+        </template>
+        <template #fileSlot>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="fileList"
+              class="upload-demo"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              drag
+              multiple
+              :show-file-list="false"
+              :before-upload="handleBeforeUpload"
+            >
+              <div>
+                <img
+                  src="@/assets/images/icon_attachment.svg"
+                  class="att-img"
+                  fit="scale-down"
+                />
+                <span style="padding-left: 8px"
+                  >将文件拖到此处,或<span style="color: #409eff"
+                    >点击上传</span
+                  ></span
+                >
+              </div>
+            </el-upload>
+            <div class="att-box">
+              <div v-for="(itemFile, index) in fileListCopy" :key="index">
+                <div class="att-item">
+                  <img
+                    src="@/assets/images/icon_dz.svg"
+                    style="cursor: pointer"
+                    fit="scale-down"
+                  />
+                  <div class="att-name">
+                    {{ itemFile.fileName }}
+                  </div>
+                  <img
+                    src="@/assets/images/icon_delete.svg"
+                    class="att-img"
+                    fit="scale-down"
+                  />
+                </div>
+              </div>
+            </div>
+          </div>
+        </template>
       </byForm>
     </div>
   </div>
@@ -20,59 +173,250 @@
 <script setup>
 import byForm from "@/components/byForm/index";
 import { ElMessage, ElMessageBox } from "element-plus";
-let loading = ref(false);
+import Editor from "@/components/Editor/index.vue";
+import { validEmail } from "@/utils/validate.js";
+import useMailStore from "@/store/modules/mail";
+const mailStore = useMailStore();
+console.log(mailStore, "wda");
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+let uploadData = ref({});
+const fileList = ref([]);
+const fileListCopy = ref([]);
 const formOption = reactive({
   inline: true,
   labelWidth: 65,
   itemWidth: 100,
-  labelPosition: "left",
+  labelPosition: "right",
 });
 const formConfig = computed(() => {
   return [
     {
-      type: "input",
-      prop: "aa",
+      type: "slot",
+      slotName: "to",
       label: "收件人",
-      required: true,
-      itemWidth: 100,
-      itemType: "text",
+      prop: "to",
+    },
+    {
+      type: "slot",
+      slotName: "cc",
+      label: "抄送人",
+      prop: "cc",
+    },
+    {
+      type: "slot",
+      slotName: "bcc",
+      label: "密送人",
+      prop: "bcc",
     },
     {
       type: "input",
-      prop: "bb",
+      prop: "subject",
       label: "主题",
       required: true,
-      itemWidth: 100,
+      itemWidth: 50.1,
       itemType: "text",
     },
     {
       type: "slot",
+      slotName: "fileSlot",
+      label: "附件",
+    },
+    {
+      type: "slot",
       slotName: "contentSlot",
-      label: " ",
+      label: "正文",
     },
     {
       type: "input",
-      prop: "cc",
+      prop: "replyTo",
       label: "发件人",
       required: true,
-      itemWidth: 100,
+      itemWidth: 50,
       itemType: "text",
     },
   ];
 });
 const rules = ref({
-  aa: [{ required: true, message: "请输入收件人", trigger: "blur" }],
-  bb: [{ required: true, message: "请输入主题", trigger: "blur" }],
-  cc: [{ required: true, message: "请输入发件人", trigger: "blur" }],
+  subject: [{ required: true, message: "请输入主题", trigger: "blur" }],
+  replyTo: [{ required: true, message: "请输入发件人", trigger: "blur" }],
 });
 const formData = reactive({
-  data: {},
+  data: {
+    content: "",
+  },
 });
+const to = ref([]);
+const cc = ref([]);
+const bcc = ref([]);
+const replyTo = ref([]);
 const submit = ref(null);
 const handleSend = () => {
-  submit.value.handleSubmit(() => {});
+  submit.value.handleSubmit(() => {
+    const data = { ...formData.data };
+    if (!to.value.length > 0) {
+      return ElMessage({
+        message: "请添加收件人",
+        type: "info",
+      });
+    }
+    if (data.content) {
+      let replyTo = [
+        {
+          address: formData.data.replyTo,
+          personal: null,
+        },
+      ];
+      const submitData = {
+        type: mailStore.selectMail.type,
+        mailboxId: mailStore.selectMail.id,
+        subject: data.subject,
+        content: data.content,
+        to: to.value,
+        cc: cc.value,
+        bcc: bcc.value,
+        replyTo: replyTo,
+        fileList: fileListCopy.value.map((x) => ({
+          fileName: x.fileName,
+          fileUrl: x.fileUrl,
+        })),
+      };
+      proxy.post("/mailService/sendMail", submitData).then((res) => {
+        console.log(res, "aa");
+      });
+    } else {
+      return ElMessage({
+        message: "请输入正文",
+        type: "info",
+      });
+    }
+  });
+};
+const updateContent = (val) => {
+  formData.data.content = val;
+};
+const handleBeforeUpload = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  fileListCopy.value.push({
+    id: res.id,
+    fileName: res.fileName,
+    path: res.fileUrl,
+    fileUrl: res.fileUrl,
+    uid: file.uid,
+  });
+};
+const handleClose = (index, val) => {
+  switch (val) {
+    case 10:
+      to.value.splice(index, 1);
+      break;
+    case 20:
+      cc.value.splice(index, 1);
+      break;
+    case 30:
+      bcc.value.splice(index, 1);
+      break;
+  }
+};
+
+const handleAdd = (val) => {
+  switch (val) {
+    case 10: {
+      if (!validEmail(formData.data.to))
+        return ElMessage({
+          message: "邮箱格式不正确",
+          type: "info",
+        });
+      to.value.push({
+        address: formData.data.to,
+        personal: null,
+      });
+      console.log(to.value, "ada");
+      formData.data.to = "";
+      break;
+    }
+    case 20: {
+      if (!validEmail(formData.data.cc))
+        return ElMessage({
+          message: "邮箱格式不正确",
+          type: "info",
+        });
+      cc.value.push({
+        address: formData.data.cc,
+        personal: null,
+      });
+      formData.data.cc = "";
+      break;
+    }
+    case 30: {
+      if (!validEmail(formData.data.bcc))
+        return ElMessage({
+          message: "邮箱格式不正确",
+          type: "info",
+        });
+      bcc.value.push({
+        address: formData.data.bcc,
+        personal: null,
+      });
+      formData.data.bcc = "";
+      break;
+    }
+  }
+};
+
+const handlePerson = () => {};
+const createFilter = (queryString) => {
+  return (restaurant) => {
+    return (
+      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+    );
+  };
+};
+
+const distributionCenterData = ref([]);
+const querySearchPerson = (queryString, callback) => {
+  const results = queryString
+    ? distributionCenterData.value.filter(createFilter(queryString))
+    : distributionCenterData.value;
+  callback(results);
 };
 </script>
 
 <style lang="scss" scoped>
+.att-img {
+  height: 18px;
+  width: 18px;
+  transform: translateY(4px);
+}
+.att-box {
+  padding-bottom: 8px;
+  display: flex;
+  flex-wrap: wrap;
+  margin-top: 10px;
+  .att-item {
+    width: 200px;
+    background-color: #eeeeee;
+    height: 28px;
+    line-height: 26px;
+    margin-right: 16px;
+    padding-left: 8px;
+    display: flex;
+    margin-bottom: 8px;
+  }
+  .att-name {
+    padding-left: 8px;
+    width: 150px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    cursor: pointer;
+  }
+}
+:deep(.el-upload-dragger) {
+  width: 250px;
+  height: 40px;
+  line-height: 40px;
+  padding: 0 8px;
+}
 </style>

+ 1 - 0
src/views/purchaseManage/supplier/supplyPrice/index.vue

@@ -529,6 +529,7 @@ const handleRemove = (index) => {
 const pushGoods = (goods) => {
   const arr = goods.map((x) => ({ ...x, productInfoId: x.id, price: "" }));
   formData.data.supplierPriceList = formData.data.supplierPriceList.concat(arr);
+  openProduct.value = false;
   return ElMessage({
     message: "添加成功!",
     type: "success",

+ 65 - 2
src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue

@@ -27,12 +27,35 @@
               text
               >查看流水</el-button
             >
+            <!-- <el-button type="primary" @click="clickSelect(item)" v-else text
+              >选择</el-button
+            > -->
             <el-button type="primary" @click="clickSelect(item)" v-else text
               >选择</el-button
             >
           </div>
         </template>
       </byTable>
+      <div>
+        <div>已选择货品</div>
+        <div style="margin: 10px 0px">
+          <el-tag
+            style="margin-right: 10px"
+            type="info"
+            closable
+            v-for="(good, index) in goodList"
+            :key="good.id"
+            @close="handleRemove(index)"
+            >{{ good.productName }}</el-tag
+          >
+        </div>
+        <div style="text-align: center">
+          <el-button @click="handleCancel" size="large">取消</el-button>
+          <el-button type="primary" @click="handleSubmit" size="large">
+            确 定
+          </el-button>
+        </div>
+      </div>
     </div>
   </div>
 </template>
@@ -41,6 +64,7 @@
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import useUserStore from "@/store/modules/user";
+import { ElMessage, ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -219,8 +243,47 @@ const checkTheFlow = (item) => {
 const deriveExcel = () => {
   console.log("deriveExcel");
 };
-const clickSelect = (item) => {
-  proxy.$emit("select", item);
+// const clickSelect = (item) => {
+//   proxy.$emit("select", item);
+// };
+const goodList = ref([]);
+const clickSelect = (row) => {
+  const flag = goodList.value.some((x) => x.id === row.id);
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  goodList.value.push({
+    ...row,
+    goodType: sourceList.value.pagination.definition,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+const handleRemove = (index) => {
+  goodList.value.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+
+const handleCancel = () => {
+  goodList.value = [];
+  proxy.$emit("cancel");
+};
+
+const handleSubmit = () => {
+  if (!goodList.value.length > 0)
+    return ElMessage({
+      message: "请添加货品",
+      type: "info",
+    });
+  proxy.$emit("select", goodList.value);
+  goodList.value = [];
 };
 </script>
 

+ 106 - 25
src/views/purchaseSales/outAndInWarehouse/manualDelivery/index.vue

@@ -14,33 +14,83 @@
             action: () => openModal(),
           },
         ]"
-        @get-list="getList">
+        @get-list="getList"
+      >
       </byTable>
     </div>
 
-    <el-dialog title="手动出库" v-if="dialogVisible" v-model="dialogVisible" width="1000" v-loading="loadingDialog">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+    <el-dialog
+      title="手动出库"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="1000"
+      v-loading="loadingDialog"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="submit"
+      >
         <template #details>
           <div style="width: 100%">
             <el-button type="primary" @click="clickAdd()">添加明细</el-button>
-            <el-table :data="formData.data.list" style="width: 100%; margin-top: 16px">
-              <el-table-column prop="productCode" label="产品编码" width="140" />
-              <el-table-column prop="productName" label="产品名称" min-width="160" />
-              <el-table-column prop="productSpec" label="规格型号" width="160" />
+            <el-table
+              :data="formData.data.list"
+              style="width: 100%; margin-top: 16px"
+            >
+              <el-table-column
+                prop="productCode"
+                label="产品编码"
+                width="140"
+              />
+              <el-table-column
+                prop="productName"
+                label="产品名称"
+                min-width="160"
+              />
+              <el-table-column
+                prop="productSpec"
+                label="规格型号"
+                width="160"
+              />
               <el-table-column prop="productUnit" label="单位" width="100" />
-              <el-table-column prop="productQuantity" label="库存数量" width="120" />
+              <el-table-column
+                prop="productQuantity"
+                label="库存数量"
+                width="120"
+              />
               <el-table-column label="出库数量" width="160">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
-                      <el-input-number v-model="row.quantity" placeholder="请输入出库数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
+                    <el-form-item
+                      :prop="'list.' + $index + '.quantity'"
+                      :rules="rules.quantity"
+                      :inline-message="true"
+                    >
+                      <el-input-number
+                        v-model="row.quantity"
+                        placeholder="请输入出库数量"
+                        style="width: 100%"
+                        :precision="0"
+                        :controls="false"
+                        :min="0"
+                      />
                     </el-form-item>
                   </div>
                 </template>
               </el-table-column>
-              <el-table-column align="center" label="操作" width="80" fixed="right">
+              <el-table-column
+                align="center"
+                label="操作"
+                width="80"
+                fixed="right"
+              >
                 <template #default="{ row, $index }">
-                  <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
+                  <el-button type="primary" link @click="handleDelete($index)"
+                    >删除</el-button
+                  >
                 </template>
               </el-table-column>
             </el-table>
@@ -49,17 +99,25 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
 
-    <el-dialog v-model="openProduct" title="选择商品" width="80%" append-to-body>
+    <el-dialog
+      v-model="openProduct"
+      title="选择商品"
+      width="80%"
+      append-to-body
+    >
       <InventoryInquiry
         :selectStatus="true"
         :warehouseId="formData.data.warehouseId"
         @cancel="openProduct = false"
-        @select="select"
-        :key="formData.data.warehouseId">
+        @select="pushGoods"
+        :key="formData.data.warehouseId"
+      >
       </InventoryInquiry>
     </el-dialog>
   </div>
@@ -170,13 +228,15 @@ const getDict = () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/stockJournalDetails/page", sourceList.value.pagination).then((res) => {
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/stockJournalDetails/page", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 getDict();
 getList();
@@ -239,7 +299,9 @@ const changeWarehouse = () => {
 };
 const select = (item) => {
   if (formData.data.list && formData.data.list.length > 0) {
-    let data = formData.data.list.filter((row) => row.productId === item.productId);
+    let data = formData.data.list.filter(
+      (row) => row.productId === item.productId
+    );
     if (data && data.length > 0) {
       return ElMessage("请勿重复添加");
     }
@@ -258,11 +320,30 @@ const select = (item) => {
     type: "success",
   });
 };
+const pushGoods = (goods) => {
+  const arr = goods.map((item) => ({
+    productCode: item.productCode,
+    productId: item.productId,
+    productName: item.productName,
+    productSpec: item.productSpec,
+    productUnit: item.productUnit,
+    productQuantity: item.quantity,
+    quantity: undefined,
+  }));
+  formData.data.list = formData.data.list.concat(arr);
+  openProduct.value = false;
+  return ElMessage({
+    message: "添加成功!",
+    type: "success",
+  });
+};
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (formData.data.list && formData.data.list.length > 0) {
       for (let i = 0; i < formData.data.list.length; i++) {
-        if (formData.data.list[i].productQuantity < formData.data.list[i].quantity) {
+        if (
+          formData.data.list[i].productQuantity < formData.data.list[i].quantity
+        ) {
           return ElMessage("出库数量不能大于库存数量");
         }
       }