Browse Source

组合 拆分功能

cz 2 years ago
parent
commit
a3b54ce1c5

+ 85 - 0
src/components/WDLY/order/details.vue

@@ -0,0 +1,85 @@
+<template>
+  <div v-loading="loading">
+    <el-form :model="formData" label-position="top">
+      <el-row>
+        <el-col :span="6">
+          <el-form-item label="客户名称"
+            >{{ formData.data.customerName }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="订单类型">
+            {{ dictDataEcho(formData.data.type, salesType) }}
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label="收件人">
+        {{ formData.data.contacts }},{{ formData.data.phone }}
+      </el-form-item>
+      <el-form-item label="收件地址">
+        {{ formData.data.countryName }},{{ formData.data.provinceName }},{{
+          formData.data.cityName
+        }},{{ formData.data.detailedAddress }}</el-form-item
+      >
+      <el-form-item label="订单明细">
+        <el-table :data="formData.data.orderDetailsList">
+          <el-table-column prop="productCode" label="产品编码" />
+          <el-table-column prop="productName" label="产品名称" />
+          <el-table-column prop="price" label="单价" />
+          <el-table-column prop="quantity" label="数量" />
+          <el-table-column prop="remark" label="备注" />
+        </el-table>
+      </el-form-item>
+      <el-row>
+        <el-col :span="6">
+          <el-form-item label="订单金额">
+            {{ moneyFormat(formData.data.amountMoney, 2) }}
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+
+<script setup>
+import { watch } from "vue";
+
+const { proxy } = getCurrentInstance();
+const props = defineProps({
+  orderData: {
+    type: Object,
+    default: {},
+  },
+});
+const loading = ref(false);
+const formData = reactive({
+  data: {},
+});
+const getDetails = () => {
+  loading.value = true;
+  proxy
+    .post("/orderInfo/detail", {
+      id: props.orderData.id,
+    })
+    .then((res) => {
+      formData.data = res;
+      loading.value = false;
+    });
+};
+
+const salesType = ref([]);
+const getDict = () => {
+  proxy.getDict(["order_sales_type"]).then((res) => {
+    salesType.value = res["order_sales_type"];
+  });
+};
+getDict();
+onMounted(() => {
+  if (props.orderData && props.orderData.id) {
+    getDetails();
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 1 - 2
src/views/WDLY/purchaseManage/arrival/index.vue

@@ -470,8 +470,7 @@ onMounted(() => {});
 .tenant {
   padding: 20px;
 }
-::deep {
-}
+
 .el-checkbox {
   display: none;
 }

+ 35 - 8
src/views/WDLY/salesMange/order/index.vue

@@ -24,7 +24,7 @@
         <template #code="{ item }">
           <div
             style="cursor: pointer; color: #409eff"
-            @click="getDtl(item, 'detail')"
+            @click="handleClickCode(item)"
           >
             {{ item.code }}
           </div>
@@ -209,6 +209,23 @@
         </span>
       </template>
     </el-dialog>
+
+    <el-dialog
+      v-model="openDetails"
+      title="订单详情"
+      width="40%"
+      append-to-body
+    >
+      <OrderDetails
+        :orderData="formData.orderData"
+        :key="formData.orderData.id"
+      ></OrderDetails>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="openDetails = false">取消</el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
   
@@ -220,6 +237,7 @@ import byForm from "@/components/byForm/index";
 import { computed, defineComponent, ref } from "vue";
 import useUserStore from "@/store/modules/user";
 import SelectProduct from "@/components/WDLY/product/SelectProduct";
+import OrderDetails from "@/components/WDLY/order/details";
 
 const loading = ref(false);
 const submitLoading = ref(false);
@@ -233,6 +251,7 @@ const sourceList = ref({
 });
 let dialogVisible = ref(false);
 let openProduct = ref(false);
+let openDetails = ref(false);
 
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
@@ -357,7 +376,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "客户名称",
-        prop: "customerInfoName",
+        prop: "customerName",
       },
     },
     {
@@ -448,6 +467,7 @@ const config = computed(() => {
 let formData = reactive({
   data: {},
   treeData: [],
+  orderData: {},
 });
 const formOption = reactive({
   inline: true,
@@ -463,12 +483,14 @@ const formConfig = reactive([
     prop: "customerInfoId",
     label: "客户名称",
     isLoad: {
-      url: `/tenantUser/list?pageNum=1&pageSize=9999&tenantId=${
-        useUserStore().user.tenantId
-      }`,
-      labelKey: "nickName",
-      labelVal: "userId",
-      method: "get",
+      url: "/customer/page",
+      req: {
+        pageNum: 1,
+        pageSize: 9999,
+      },
+      labelKey: "name",
+      labelVal: "id",
+      method: "post",
       resUrl: "rows",
     },
   },
@@ -677,6 +699,11 @@ const handleRemove = (index) => {
     type: "success",
   });
 };
+
+const handleClickCode = (row) => {
+  formData.orderData = row;
+  openDetails.value = true;
+};
 </script>
   
 <style lang="scss" scoped>

+ 228 - 61
src/views/WDLY/stockManage/productCombination/index.vue

@@ -27,7 +27,7 @@
       </byTable>
     </div>
     <el-dialog
-      :title="modalType == 'add' ? '产品组合' : '调仓接收'"
+      :title="modalType == 'add' ? '产品组合' : '组合详情'"
       v-model="dialogVisible"
       width="800"
       v-loading="loading"
@@ -45,29 +45,40 @@
               type="primary"
               @click="openProduct = true"
               style="margin-bottom: 10px"
+              v-if="modalType == 'add'"
             >
               添加产品
             </el-button>
-            <el-table :data="formData.data.stockWaitDetailsList">
-              <el-table-column prop="name" label="产品名称" />
-              <el-table-column prop="name" label="可组合数量" />
-              <el-table-column prop="quantity" label="本次组合" min-width="150">
+            <el-table :data="formData.data.groupRecordDetailsList">
+              <el-table-column prop="productName" label="产品名称" />
+              <el-table-column
+                prop="canSum"
+                label="可组合数量"
+                v-if="modalType == 'add'"
+              />
+              <el-table-column prop="groupNum" label="组合数量" min-width="150">
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'stockWaitDetailsList.' + $index + '.quantity'"
-                    :rules="rules.quantity"
+                    :prop="'groupRecordDetailsList.' + $index + '.groupNum'"
+                    :rules="rules.groupNum"
                     :inline-message="true"
                   >
                     <el-input-number
-                      v-model="row.quantity"
-                      :precision="4"
+                      v-model="row.groupNum"
+                      :precision="0"
                       :controls="false"
                       :min="0"
+                      @change="() => changeCanSum(row, $index)"
                     />
                   </el-form-item>
                 </template>
               </el-table-column>
-              <el-table-column prop="zip" label="操作" width="100">
+              <el-table-column
+                prop="zip"
+                label="操作"
+                width="100"
+                v-if="modalType == 'add'"
+              >
                 <template #default="{ $index }">
                   <el-button type="primary" link @click="handleRemove($index)"
                     >删除</el-button
@@ -78,7 +89,7 @@
           </div>
         </template>
       </byForm>
-      <template #footer>
+      <template #footer v-if="modalType == 'add'">
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
         <el-button
           type="primary"
@@ -111,7 +122,7 @@
 import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
-import { computed, defineComponent, ref } from "vue";
+import { computed, defineComponent, ref, watch } from "vue";
 import useUserStore from "@/store/modules/user";
 import SelectProduct from "@/components/WDLY/product/SelectProduct";
 
@@ -123,6 +134,7 @@ const sourceList = ref({
     total: 3,
     pageNum: 1,
     pageSize: 10,
+    type: "1",
   },
 });
 let dialogVisible = ref(false);
@@ -131,8 +143,13 @@ let openProduct = ref(false);
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  code: [{ required: true, message: "请输入spu编码", trigger: "blur" }],
-  name: [{ required: true, message: "请输入spu名称", trigger: "blur" }],
+  productWarehouseId: [
+    { required: true, message: "请选择半成品所在仓库", trigger: "change" },
+  ],
+  groupWarehouseId: [
+    { required: true, message: "请选择组合后放置仓库", trigger: "change" },
+  ],
+  groupNum: [{ required: true, message: "请输入分拆数量", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([]);
@@ -141,57 +158,57 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "单号",
-        prop: "code",
+        label: "组合编码",
+        prop: "productCode",
       },
     },
     {
       attrs: {
-        label: "调出仓库",
-        prop: "name",
+        label: "组合名称",
+        prop: "productName",
       },
     },
     {
       attrs: {
-        label: "调出人",
-        prop: "remark",
+        label: "规格型号",
+        prop: "productSpec",
       },
     },
     {
       attrs: {
-        label: "调出时间",
-        prop: "remark",
+        label: "半成品所在仓库",
+        prop: "productWarehouseName",
       },
     },
     {
       attrs: {
-        label: "接收状态",
-        prop: "remark",
+        label: "组合后放置仓库",
+        prop: "groupWarehouseName",
       },
     },
     {
       attrs: {
-        label: "调入仓库",
-        prop: "remark",
+        label: "组合数量",
+        prop: "groupNum",
       },
     },
     {
       attrs: {
-        label: "接收人",
-        prop: "remark",
+        label: "操作人",
+        prop: "createUserName",
       },
     },
     {
       attrs: {
-        label: "接收时间",
-        prop: "remark",
+        label: "操作时间",
+        prop: "createTime",
       },
     },
 
     {
       attrs: {
         label: "操作",
-        width: "200",
+        width: "100",
         align: "right",
       },
       // 渲染 el-button,一般用在最后一列。
@@ -199,18 +216,7 @@ const config = computed(() => {
         return [
           {
             attrs: {
-              label: "接收",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-          {
-            attrs: {
-              label: "打印",
+              label: "查看",
               type: "primary",
               text: true,
             },
@@ -244,14 +250,14 @@ const formConfig = reactive([
   },
   {
     type: "select",
-    prop: "warehouseId",
+    prop: "productWarehouseId",
     label: "半成品所在仓库",
     itemWidth: 33,
     data: [],
   },
   {
     type: "select",
-    prop: "warehouseId",
+    prop: "groupWarehouseId",
     label: "组合后放置仓库",
     itemWidth: 33,
     data: [],
@@ -270,7 +276,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/productSpu/page", sourceList.value.pagination)
+    .post("/groupRecordDetails/page", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
       sourceList.value.data = message.rows;
@@ -283,16 +289,43 @@ const getList = async (req) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
+  formConfig[1].disabled = false;
+  formConfig[2].disabled = false;
   formData.data = {
-    stockWaitDetailsList: [],
+    type: "1",
+    groupRecordDetailsList: [],
   };
 };
 
 const submitForm = () => {
-  console.log(byform.value);
   byform.value.handleSubmit((valid) => {
+    const list = formData.data.groupRecordDetailsList;
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      if (e.groupNum == 0) {
+        return ElMessage({
+          message: "组合数量不能为0!",
+          type: "info",
+        });
+      }
+      if (e.groupNum > e.canSum) {
+        return ElMessage({
+          message: "组合数量不可大于可组合数量!",
+          type: "info",
+        });
+      }
+    }
     submitLoading.value = true;
-    proxy.post("/productSpu/" + modalType.value, formData.data).then(
+    const data = {
+      type: formData.data.type,
+      productWarehouseId: formData.data.productWarehouseId,
+      groupWarehouseId: formData.data.groupWarehouseId,
+      groupRecordDetailsList: list.map((x) => ({
+        productId: x.productId,
+        groupNum: x.groupNum,
+      })),
+    };
+    proxy.post("/groupRecordDetails/" + modalType.value, data).then(
       (res) => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
@@ -309,11 +342,16 @@ const submitForm = () => {
 
 const getDtl = (row) => {
   modalType.value = "edit";
-  proxy.post("/productSpu/detail", { id: row.id }).then((res) => {
-    res.stockWaitDetailsList = res.productInfoList;
-    formData.data = res;
-    dialogVisible.value = true;
-  });
+  proxy
+    .post("/groupRecordDetails/detail", { id: row.groupRecordId })
+    .then((res) => {
+      formConfig[1].disabled = true;
+      formConfig[2].disabled = true;
+      formData.data.productWarehouseId = row.productWarehouseId;
+      formData.data.groupWarehouseId = row.groupWarehouseId;
+      formData.data.groupRecordDetailsList = res;
+      dialogVisible.value = true;
+    });
 };
 
 const warehouseList = ref([]);
@@ -322,7 +360,7 @@ const warehouseListData = () => {
   proxy
     .post("/warehouse/page", {
       pageNum: 1,
-      pageSize: 10,
+      pageSize: 9999,
     })
     .then((message) => {
       warehouseList.value = message.rows;
@@ -340,16 +378,20 @@ getList();
 warehouseListData();
 
 const handleSelect = (row) => {
-  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  const flag = formData.data.groupRecordDetailsList.some(
+    (x) => x.productId === row.id
+  );
   if (flag)
     return ElMessage({
       message: "该物品已选择",
       type: "info",
     });
-  formData.data.stockWaitDetailsList.push({
-    name: row.name,
-    code: row.code,
-    id: row.id,
+  formData.data.groupRecordDetailsList.push({
+    productName: row.name,
+    productCode: row.code,
+    productSpec: row.spec,
+    productId: row.id,
+    groupNum: 0,
   });
   return ElMessage({
     message: "选择成功",
@@ -358,12 +400,137 @@ const handleSelect = (row) => {
 };
 
 const handleRemove = (index) => {
-  formData.data.stockWaitDetailsList.splice(index, 1);
+  formData.data.groupRecordDetailsList.splice(index, 1);
   return ElMessage({
     message: "删除成功",
     type: "success",
   });
 };
+const stockMapData = reactive({
+  data: {},
+});
+watchEffect(() => {
+  if (
+    formData.data.productWarehouseId &&
+    formData.data.groupRecordDetailsList.length > 0
+  ) {
+    proxy
+      .post("/groupRecordDetails/getCombinableQuantity", {
+        warehouseId: formData.data.productWarehouseId,
+        productIdList: formData.data.groupRecordDetailsList.map(
+          (x) => x.productId
+        ),
+      })
+      .then((res) => {
+        stockMapData.data = res.stockMap;
+        const stockMap = { ...stockMapData.data };
+        const list = formData.data.groupRecordDetailsList;
+        for (let i = 0; i < list.length; i++) {
+          const e = list[i];
+          for (const key in res.combinableQuantity) {
+            if (e.productId === key) {
+              e.needProductIdMap = res.combinableQuantity[key]; //赋值需要的半成品id
+            }
+          }
+        }
+        for (let i = 0; i < list.length; i++) {
+          const e = list[i];
+          const canSumMap = {};
+          for (const needKey in e.needProductIdMap) {
+            if (stockMap.hasOwnProperty(needKey)) {
+              canSumMap[needKey] =
+                stockMap[needKey] / e.needProductIdMap[needKey];
+            } else {
+              canSumMap[needKey] = 0;
+            }
+          }
+          e.canSumArr = Object.values(canSumMap);
+          e.canSum = Math.floor(Math.min(...e.canSumArr)); //取出最小值且向下取整
+        }
+      });
+  }
+});
+
+const changeCanSum = (row, rowIndex) => {
+  const list = formData.data.groupRecordDetailsList;
+  const stockMap = { ...stockMapData.data };
+  if (rowIndex < list.length - 1) {
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      const canSumMap = {};
+      for (const key in e.needProductIdMap) {
+        if (stockMap.hasOwnProperty(key)) {
+          if (e.groupNum && e.groupNum > 0) {
+            stockMap[key] -= e.needProductIdMap[key] * e.groupNum;
+          }
+        } else {
+          canSumMap[key] = 0;
+        }
+        // canSumMap[key] = stockMap[key] / e.needProductIdMap[key];
+        if (row.productId != e.productId) {
+          // console.log("aaa");
+          canSumMap[key] = stockMap[key] / e.needProductIdMap[key];
+        }
+      }
+      e.canSumArr =
+        Object.values(canSumMap).length > 0
+          ? Object.values(canSumMap)
+          : [...e.canSumArr];
+      e.canSum = Math.floor(Math.min(...e.canSumArr)); //取出最小值且向下取整
+    }
+  } else {
+    for (let i = list.length - 1; i >= 0; i--) {
+      const e = list[i];
+      const canSumMap = {};
+      for (const key in e.needProductIdMap) {
+        if (stockMap.hasOwnProperty(key)) {
+          if (e.groupNum && e.groupNum > 0) {
+            stockMap[key] -= e.needProductIdMap[key] * e.groupNum;
+          }
+        } else {
+          canSumMap[key] = 0;
+        }
+        // canSumMap[key] = stockMap[key] / e.needProductIdMap[key];
+        if (row.productId != e.productId) {
+          // console.log("aaa");
+          canSumMap[key] = stockMap[key] / e.needProductIdMap[key];
+        }
+      }
+      e.canSumArr =
+        Object.values(canSumMap).length > 0
+          ? Object.values(canSumMap)
+          : [...e.canSumArr];
+      e.canSum = Math.floor(Math.min(...e.canSumArr)); //取出最小值且向下取整
+    }
+  }
+
+  // for (let i = 0; i < list.length; i++) {
+  //   const e = list[i];
+  //   let canSumMap = {};
+  //   for (const needKey in e.needProductIdMap) {
+  //     if (stockMap.hasOwnProperty(needKey)) {
+  //       if (e.groupNum && e.groupNum > 0) {
+  //         stockMap[needKey] =
+  //           stockMap[needKey] - e.needProductIdMap[needKey] * e.groupNum;
+  //       } else {
+  //         stockMap[needKey] =
+  //           stockMap[needKey] - e.needProductIdMap[needKey] * -1;
+  //       }
+
+  //       if (row.productId != e.productId) {
+  //         canSumMap[needKey] = stockMap[needKey] / e.needProductIdMap[needKey];
+  //       }
+  //     } else {
+  //       canSumMap[needKey] = 0;
+  //     }
+  //   }
+  //   e.canSumArr = Object.values(canSumMap).length
+  //     ? Object.values(canSumMap)
+  //     : [...e.canSumArr];
+  //   e.canSum = Math.floor(Math.min(...e.canSumArr)); //取出最小值且向下取整
+  //   // e.canSum = e.canSum - 1;
+  // }
+};
 </script>
   
 <style lang="scss" scoped>

+ 103 - 63
src/views/WDLY/stockManage/productSplit/index.vue

@@ -15,7 +15,7 @@
         }"
         :action-list="[
           {
-            text: '产品分',
+            text: '产品分',
             action: () => openModal('add'),
           },
         ]"
@@ -27,7 +27,7 @@
       </byTable>
     </div>
     <el-dialog
-      :title="modalType == 'add' ? '产品拆分' : '调仓接收'"
+      :title="modalType == 'add' ? '产品分拆' : '分拆详情'"
       v-model="dialogVisible"
       width="800"
       v-loading="loading"
@@ -45,29 +45,39 @@
               type="primary"
               @click="openProduct = true"
               style="margin-bottom: 10px"
+              v-if="modalType == 'add'"
             >
               添加产品
             </el-button>
-            <el-table :data="formData.data.stockWaitDetailsList">
-              <el-table-column prop="name" label="产品名称" />
-              <el-table-column prop="name" label="可拆分数量" />
-              <el-table-column prop="quantity" label="本次拆分" min-width="150">
+            <el-table :data="formData.data.groupRecordDetailsList">
+              <el-table-column prop="productName" label="产品名称" />
+              <el-table-column
+                prop="canSum"
+                label="库存数量"
+                v-if="modalType == 'add'"
+              />
+              <el-table-column prop="groupNum" label="拆分数量" min-width="150">
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'stockWaitDetailsList.' + $index + '.quantity'"
-                    :rules="rules.quantity"
+                    :prop="'groupRecordDetailsList.' + $index + '.groupNum'"
+                    :rules="rules.groupNum"
                     :inline-message="true"
                   >
                     <el-input-number
-                      v-model="row.quantity"
-                      :precision="4"
+                      v-model="row.groupNum"
+                      :precision="0"
                       :controls="false"
                       :min="0"
                     />
                   </el-form-item>
                 </template>
               </el-table-column>
-              <el-table-column prop="zip" label="操作" width="100">
+              <el-table-column
+                prop="zip"
+                label="操作"
+                width="100"
+                v-if="modalType == 'add'"
+              >
                 <template #default="{ $index }">
                   <el-button type="primary" link @click="handleRemove($index)"
                     >删除</el-button
@@ -78,7 +88,7 @@
           </div>
         </template>
       </byForm>
-      <template #footer>
+      <template #footer v-if="modalType == 'add'">
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
         <el-button
           type="primary"
@@ -111,7 +121,7 @@
 import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
-import { computed, defineComponent, ref } from "vue";
+import { computed, defineComponent, ref, watch } from "vue";
 import useUserStore from "@/store/modules/user";
 import SelectProduct from "@/components/WDLY/product/SelectProduct";
 
@@ -123,6 +133,7 @@ const sourceList = ref({
     total: 3,
     pageNum: 1,
     pageSize: 10,
+    type: "2",
   },
 });
 let dialogVisible = ref(false);
@@ -131,8 +142,13 @@ let openProduct = ref(false);
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  code: [{ required: true, message: "请输入spu编码", trigger: "blur" }],
-  name: [{ required: true, message: "请输入spu名称", trigger: "blur" }],
+  productWarehouseId: [
+    { required: true, message: "请选择半成品所在仓库", trigger: "change" },
+  ],
+  groupWarehouseId: [
+    { required: true, message: "请选择组合后放置仓库", trigger: "change" },
+  ],
+  groupNum: [{ required: true, message: "请输入分拆数量", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([]);
@@ -141,53 +157,52 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "单号",
-        prop: "code",
+        label: "组合编码",
+        prop: "productCode",
       },
     },
     {
       attrs: {
-        label: "调出仓库",
-        prop: "name",
+        label: "组合名称",
+        prop: "productName",
       },
     },
     {
       attrs: {
-        label: "调出人",
-        prop: "remark",
+        label: "规格型号",
+        prop: "productSpec",
       },
     },
     {
       attrs: {
-        label: "调出时间",
-        prop: "remark",
+        label: "拆分前所在仓库",
+        prop: "groupWarehouseName",
       },
     },
     {
       attrs: {
-        label: "接收状态",
-        prop: "remark",
+        label: "拆分后放置仓库",
+        prop: "productWarehouseName",
       },
     },
     {
       attrs: {
-        label: "调入仓库",
-        prop: "remark",
+        label: "拆分数量",
+        prop: "groupNum",
       },
     },
     {
       attrs: {
-        label: "接收人",
-        prop: "remark",
+        label: "操作人",
+        prop: "createUserName",
       },
     },
     {
       attrs: {
-        label: "接收时间",
-        prop: "remark",
+        label: "操作时间",
+        prop: "createTime",
       },
     },
-
     {
       attrs: {
         label: "操作",
@@ -199,18 +214,7 @@ const config = computed(() => {
         return [
           {
             attrs: {
-              label: "接收",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-          {
-            attrs: {
-              label: "打印",
+              label: "查看",
               type: "primary",
               text: true,
             },
@@ -244,14 +248,14 @@ const formConfig = reactive([
   },
   {
     type: "select",
-    prop: "warehouseId",
-    label: "半成品所在仓库",
+    prop: "groupWarehouseId",
+    label: "拆分前所在仓库",
     itemWidth: 33,
     data: [],
   },
   {
     type: "select",
-    prop: "warehouseId",
+    prop: "productWarehouseId",
     label: "拆分后放置仓库",
     itemWidth: 33,
     data: [],
@@ -270,7 +274,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/productSpu/page", sourceList.value.pagination)
+    .post("/groupRecordDetails/page", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
       sourceList.value.data = message.rows;
@@ -283,16 +287,43 @@ const getList = async (req) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
+  formConfig[1].disabled = false;
+  formConfig[2].disabled = false;
   formData.data = {
-    stockWaitDetailsList: [],
+    type: "2",
+    groupRecordDetailsList: [],
   };
 };
 
 const submitForm = () => {
-  console.log(byform.value);
   byform.value.handleSubmit((valid) => {
+    const list = formData.data.groupRecordDetailsList;
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      if (e.groupNum == 0) {
+        return ElMessage({
+          message: "拆分数量不能为0!",
+          type: "info",
+        });
+      }
+      if (e.groupNum > e.canSum) {
+        return ElMessage({
+          message: "组合数量不可大于可组合数量!",
+          type: "info",
+        });
+      }
+    }
     submitLoading.value = true;
-    proxy.post("/productSpu/" + modalType.value, formData.data).then(
+    const data = {
+      type: formData.data.type,
+      productWarehouseId: formData.data.productWarehouseId,
+      groupWarehouseId: formData.data.groupWarehouseId,
+      groupRecordDetailsList: list.map((x) => ({
+        productId: x.productId,
+        groupNum: x.groupNum,
+      })),
+    };
+    proxy.post("/groupRecordDetails/" + modalType.value, data).then(
       (res) => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
@@ -309,11 +340,16 @@ const submitForm = () => {
 
 const getDtl = (row) => {
   modalType.value = "edit";
-  proxy.post("/productSpu/detail", { id: row.id }).then((res) => {
-    res.stockWaitDetailsList = res.productInfoList;
-    formData.data = res;
-    dialogVisible.value = true;
-  });
+  proxy
+    .post("/groupRecordDetails/detail", { id: row.groupRecordId })
+    .then((res) => {
+      formConfig[1].disabled = true;
+      formConfig[2].disabled = true;
+      formData.data.productWarehouseId = row.productWarehouseId;
+      formData.data.groupWarehouseId = row.groupWarehouseId;
+      formData.data.groupRecordDetailsList = res;
+      dialogVisible.value = true;
+    });
 };
 
 const warehouseList = ref([]);
@@ -322,7 +358,7 @@ const warehouseListData = () => {
   proxy
     .post("/warehouse/page", {
       pageNum: 1,
-      pageSize: 10,
+      pageSize: 9999,
     })
     .then((message) => {
       warehouseList.value = message.rows;
@@ -340,16 +376,20 @@ getList();
 warehouseListData();
 
 const handleSelect = (row) => {
-  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  const flag = formData.data.groupRecordDetailsList.some(
+    (x) => x.productId === row.id
+  );
   if (flag)
     return ElMessage({
       message: "该物品已选择",
       type: "info",
     });
-  formData.data.stockWaitDetailsList.push({
-    name: row.name,
-    code: row.code,
-    id: row.id,
+  formData.data.groupRecordDetailsList.push({
+    productName: row.name,
+    productCode: row.code,
+    productSpec: row.spec,
+    productId: row.id,
+    groupNum: 0,
   });
   return ElMessage({
     message: "选择成功",
@@ -358,7 +398,7 @@ const handleSelect = (row) => {
 };
 
 const handleRemove = (index) => {
-  formData.data.stockWaitDetailsList.splice(index, 1);
+  formData.data.groupRecordDetailsList.splice(index, 1);
   return ElMessage({
     message: "删除成功",
     type: "success",

+ 36 - 29
src/views/purchaseSales/stockManage/inventory/index.vue

@@ -48,21 +48,25 @@
             >
               添加物品
             </el-button>
-            <el-table :data="formData.data.stockWaitDetailsList">
+            <el-table :data="formData.data.list">
               <el-table-column prop="name" label="物品编码" />
-              <el-table-column prop="name" label="物品名称" />
+              <el-table-column prop="productName" label="物品名称" />
               <el-table-column prop="name" label="规格型号" />
               <el-table-column prop="name" label="单位" />
               <el-table-column prop="name" label="库存数量" />
-              <el-table-column prop="quantity" label="盘点数量" min-width="150">
+              <el-table-column
+                prop="checkQuantity"
+                label="盘点数量"
+                min-width="150"
+              >
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'stockWaitDetailsList.' + $index + '.quantity'"
-                    :rules="rules.quantity"
+                    :prop="'list.' + $index + '.checkQuantity'"
+                    :rules="rules.checkQuantity"
                     :inline-message="true"
                   >
                     <el-input-number
-                      v-model="row.quantity"
+                      v-model="row.checkQuantity"
                       :precision="4"
                       :controls="false"
                       :min="0"
@@ -133,8 +137,12 @@ let openProduct = ref(false);
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  code: [{ required: true, message: "请输入spu编码", trigger: "blur" }],
-  name: [{ required: true, message: "请输入spu名称", trigger: "blur" }],
+  checkQuantity: [
+    { required: true, message: "请输入盘点数量", trigger: "blur" },
+  ],
+  warehouseId: [
+    { required: true, message: "请选择盘点仓库", trigger: "change" },
+  ],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
@@ -159,53 +167,52 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "单号",
+        label: "盘点单号",
         prop: "code",
       },
     },
     {
       attrs: {
-        label: "调出仓库",
+        label: "仓库名称",
         prop: "name",
       },
     },
     {
       attrs: {
-        label: "调出人",
+        label: "盘点时间",
         prop: "remark",
       },
     },
     {
       attrs: {
-        label: "调出时间",
+        label: "盘点人",
         prop: "remark",
       },
     },
     {
       attrs: {
-        label: "接收状态",
+        label: "盘点结论",
         prop: "remark",
       },
     },
     {
       attrs: {
-        label: "调入仓库",
+        label: "盘点物品数",
         prop: "remark",
       },
     },
     {
       attrs: {
-        label: "接收人",
+        label: "正常物品数",
         prop: "remark",
       },
     },
     {
       attrs: {
-        label: "接收时间",
+        label: "异常物品数",
         prop: "remark",
       },
     },
-
     {
       attrs: {
         label: "操作",
@@ -287,7 +294,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/productSpu/page", sourceList.value.pagination)
+    .post("/stockCheck/page", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
       sourceList.value.data = message.rows;
@@ -301,7 +308,7 @@ const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
   formData.data = {
-    stockWaitDetailsList: [],
+    list: [],
   };
 };
 
@@ -309,7 +316,7 @@ const submitForm = () => {
   console.log(byform.value);
   byform.value.handleSubmit((valid) => {
     submitLoading.value = true;
-    proxy.post("/productSpu/" + modalType.value, formData.data).then(
+    proxy.post("/stockCheck/" + modalType.value, formData.data).then(
       (res) => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
@@ -327,7 +334,7 @@ const submitForm = () => {
 const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/productSpu/detail", { id: row.id }).then((res) => {
-    res.stockWaitDetailsList = res.productInfoList;
+    res.list = res.productInfoList;
     formData.data = res;
     dialogVisible.value = true;
   });
@@ -336,13 +343,13 @@ const getDtl = (row) => {
 getList();
 
 const handleSelect = (row) => {
-  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  const flag = formData.data.list.some((x) => x.id === row.id);
   if (flag)
     return ElMessage({
       message: "该物品已选择",
       type: "info",
     });
-  formData.data.stockWaitDetailsList.push({
+  formData.data.list.push({
     name: row.name,
     code: row.code,
     id: row.id,
@@ -355,13 +362,13 @@ const handleSelect = (row) => {
 
 const pushGoods = (goods) => {
   const arr = goods.map((x) => ({
-    linkProductId: x.id,
-    linkQuantity: "",
-    name: x.name,
+    productId: x.id,
+    checkQuantity: "",
+    checkQuantity: "",
+    productName: x.name,
     code: x.code,
   }));
-  formData.data.stockWaitDetailsList =
-    formData.data.stockWaitDetailsList.concat(arr);
+  formData.data.list = formData.data.list.concat(arr);
   return ElMessage({
     message: "添加成功!",
     type: "success",
@@ -369,7 +376,7 @@ const pushGoods = (goods) => {
 };
 
 const handleRemove = (index) => {
-  formData.data.stockWaitDetailsList.splice(index, 1);
+  formData.data.list.splice(index, 1);
   return ElMessage({
     message: "删除成功",
     type: "success",

+ 26 - 20
src/views/salesMange/saleContract/claim/index.vue

@@ -16,8 +16,8 @@
         :action-list="[]"
         @get-list="getList"
       >
-        <template #slotName="{ item }">
-          {{ item.createTime }}
+        <template #money="{ item }">
+          {{ item.currency }} {{ moneyFormat(item.amount) }}
         </template>
       </byTable>
     </div>
@@ -100,6 +100,7 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     type: 1,
+    dataType: "1",
   },
 });
 let dialogVisible = ref(false);
@@ -150,7 +151,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "账户名称",
-        prop: "businessType",
+        prop: "accountManagementName",
       },
       // render(type) {
       //   return proxy.dictDataEcho(type, warehouseType.value);
@@ -159,47 +160,48 @@ const config = computed(() => {
     {
       attrs: {
         label: "到账金额",
-        prop: "code",
+        prop: "amount",
+        slot: "money",
       },
     },
 
     {
       attrs: {
         label: "到账时间",
-        prop: "logisticsCompanyName",
+        prop: "transactionTime",
       },
     },
     {
       attrs: {
         label: "对方账户名称",
-        prop: "receiptWarehouseName",
+        prop: "name",
       },
     },
     {
       attrs: {
         label: "对方开户银行",
-        prop: "operatorName",
+        prop: "openingBank",
       },
     },
     {
       attrs: {
         label: "对方账号",
-        prop: "createTime",
+        prop: "accountOpening",
       },
     },
     {
       attrs: {
         label: "摘要",
-        prop: "createTime",
+        prop: "remarks",
       },
     },
     {
       attrs: {
         label: "认领状态",
-        prop: "status",
+        prop: "isClaim",
       },
-      render(status) {
-        return status == 0 ? "未入库" : status == 1 ? "部分入库" : "";
+      render(isClaim) {
+        return isClaim == 1 ? "已认领" : isClaim == 0 ? "未认领" : "";
       },
     },
     {
@@ -211,7 +213,7 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          !row.isForbid
+          row.isClaim == 0
             ? {
                 attrs: {
                   label: "认领",
@@ -225,7 +227,9 @@ const config = computed(() => {
                   getDtl(row);
                 },
               }
-            : {
+            : {},
+          row.isClaim == 1
+            ? {
                 attrs: {
                   label: "取消认领",
                   text: true,
@@ -257,7 +261,8 @@ const config = computed(() => {
                       });
                   });
                 },
-              },
+              }
+            : {},
         ];
       },
     },
@@ -347,13 +352,14 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/stockWait/pageByWdly", sourceList.value.pagination)
+    .post("/accountRunningWater/page", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
-      sourceList.value.data = message.rows.map((x) => ({
-        ...x,
-        ...JSON.parse(x.victoriatouristJson),
-      }));
+      sourceList.value.data = message.rows;
+      // .map((x) => ({
+      //   ...x,
+      //   ...JSON.parse(x.victoriatouristJson),
+      // }));
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
         loading.value = false;

+ 693 - 0
src/views/salesMange/shipmentMange/packing/index.vue

@@ -0,0 +1,693 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: selectRow,
+          'select-all': selectRow,
+        }"
+        :action-list="[
+          {
+            text: '出货',
+            disabled: selectData.length === 0,
+            action: () => openModal(),
+          },
+          {
+            text: '产品装箱',
+            action: () => openModal(),
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #fileSlot="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="handleClickFile(item)"
+          >
+            {{ item.fileName }}
+          </div>
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      title="产品装箱"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <el-form
+        :model="formData.data"
+        :rules="rules"
+        ref="formDom"
+        label-position="top"
+      >
+        <el-row :gutter="10">
+          <el-col :span="8">
+            <el-form-item label="客户名称" prop="supplyId">
+              <el-select
+                v-model="formData.data.supplyId"
+                placeholder="请选择"
+                @change="handleChangeSupplier"
+                filterable
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in supplierData"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="选择合同" prop="supplyId">
+          <el-select
+            v-model="formData.data.supplyId"
+            placeholder="请选择"
+            @change="handleChangeSupplier"
+            filterable
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in supplierData"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="合同明细" prop="purchaseContent">
+          <el-table :data="formData.data.purchaseDetailList">
+            <el-table-column type="selection" label="" width="50" />
+            <el-table-column prop="productCode" label="合同编码" />
+            <el-table-column prop="productName" label="产品名称" />
+            <el-table-column prop="productSpec" label="合同数量" />
+            <el-table-column prop="productUnit" label="待装箱数量" />
+            <el-table-column prop="count" label="装箱数量" min-width="150">
+              <template #default="{ row, $index }">
+                <el-form-item
+                  :prop="'purchaseDetailList.' + $index + '.count'"
+                  :rules="rules.count"
+                  :inline-message="true"
+                >
+                  <el-input-number
+                    v-model="row.count"
+                    :precision="4"
+                    :controls="false"
+                    :min="0"
+                  />
+                </el-form-item>
+              </template>
+            </el-table-column>
+
+            <!-- <el-table-column prop="zip" label="操作" width="100">
+              <template #default="{ $index }">
+                <el-button type="primary" link @click="handleRemove($index)"
+                  >删除</el-button
+                >
+              </template>
+            </el-table-column> -->
+          </el-table>
+          <el-button
+            type="primary"
+            @click="openProduct = true"
+            style="margin-top: 10px; width: 100%"
+          >
+            装箱
+          </el-button>
+        </el-form-item>
+
+        <el-form-item label="装箱明细">
+          <div class="box">
+            <div ref="">箱规</div>
+            <el-row :gutter="10">
+              <el-col :span="5">
+                <el-form-item label="箱数" prop="supplyId">
+                  <el-input
+                    v-model="formData.data.a"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="5">
+                <el-form-item label="净重(kg)" prop="supplyId">
+                  <el-input
+                    v-model="formData.data.a"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="5">
+                <el-form-item label="毛重(kg)" prop="supplyId">
+                  <el-input
+                    v-model="formData.data.a"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="9">
+                <el-row>
+                  <el-form-item label="尺寸(cm³)" required>
+                    <el-col :span="1"></el-col>
+                    <el-col :span="7">
+                      <el-input
+                        v-model="formData.data.a"
+                        placeholder="长"
+                      ></el-input>
+                    </el-col>
+                    <el-col :span="1" style="text-align: center"> * </el-col>
+                    <el-col :span="7">
+                      <el-input
+                        v-model="formData.data.a"
+                        placeholder="宽"
+                      ></el-input>
+                    </el-col>
+                    <el-col :span="1" style="text-align: center"> * </el-col>
+                    <el-col :span="7">
+                      <el-input
+                        v-model="formData.data.a"
+                        placeholder="高"
+                      ></el-input>
+                    </el-col>
+                  </el-form-item>
+                </el-row>
+              </el-col>
+            </el-row>
+            <div class="line"></div>
+            <el-form-item label="关联合同产品">
+              <div class="flex-box">
+                <div class="item">
+                  <div>合同编码:PO-2301-001</div>
+                  <div>产品名称:PO-2301-001</div>
+                  <div>每箱数量:PO-2301-001</div>
+                </div>
+              </div>
+            </el-form-item>
+            <div class="bottom-arrow" v-show="fade">
+              <span style="margin-right: 5px"> 自定义装箱明细</span>
+              <el-icon><ArrowDownBold /></el-icon>
+            </div>
+            <div class="bottom-arrow" v-show="true">
+              <span style="margin-right: 5px"> 收起</span>
+              <el-icon><ArrowUpBold /></el-icon>
+            </div>
+            <el-form-item prop="自定义装箱">
+              <el-button
+                type="primary"
+                @click="openProduct = true"
+                style="margin-bottom: 10px"
+              >
+                添加行
+              </el-button>
+              <el-table :data="formData.data.purchaseDetailList">
+                <el-table-column prop="count" label="货物描述">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'purchaseDetailList.' + $index + '.count'"
+                      :rules="rules.count"
+                      :inline-message="true"
+                    >
+                      <el-input v-model="row.count" placeholder="请输入" />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="count" label="单位" width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'purchaseDetailList.' + $index + '.count'"
+                      :rules="rules.count"
+                      :inline-message="true"
+                    >
+                      <el-input-number
+                        v-model="row.count"
+                        :precision="4"
+                        :controls="false"
+                        :min="0"
+                      />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="count" label="数量" width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'purchaseDetailList.' + $index + '.count'"
+                      :rules="rules.count"
+                      :inline-message="true"
+                    >
+                      <el-input-number
+                        v-model="row.count"
+                        :precision="4"
+                        :controls="false"
+                        :min="0"
+                      />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="zip" label="操作" width="100">
+                  <template #default="{ $index }">
+                    <el-button type="primary" link @click="handleRemove($index)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-form-item>
+          </div>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import FileUpload from "@/components/FileUpload/index";
+import { computed, defineComponent, ref } from "vue";
+import { getToken } from "@/utils/auth";
+
+const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
+const headers = ref({ Authorization: "Bearer " + getToken() });
+const uploadData = ref({});
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    status: "",
+  },
+});
+let dialogVisible = ref(false);
+let modalType = ref("add");
+let fileList = ref([]);
+let rules = ref({
+  name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "出货状态",
+    prop: "productType",
+    data: [
+      {
+        label: "产品",
+        value: "1",
+      },
+      {
+        label: "物料",
+        value: "2",
+      },
+    ],
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      type: "selection",
+      // attrs: {
+      //   checkAtt: "isCheck",
+      // },
+    },
+    {
+      attrs: {
+        label: "合同号",
+        prop: "subscribeCode",
+      },
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "subscribeCode",
+      },
+    },
+
+    {
+      attrs: {
+        label: "总箱数",
+        prop: "productCategory",
+      },
+    },
+    {
+      attrs: {
+        label: "净重",
+        prop: "productCode",
+      },
+    },
+    {
+      attrs: {
+        label: "毛重",
+        prop: "productName",
+      },
+    },
+    {
+      attrs: {
+        label: "长",
+        prop: "productUnit",
+      },
+    },
+
+    {
+      attrs: {
+        label: "宽",
+        prop: "count",
+      },
+    },
+    {
+      attrs: {
+        label: "高",
+        prop: "receiptWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "总体积",
+        prop: "planArrivalTime",
+      },
+    },
+
+    {
+      attrs: {
+        label: "出货状态",
+        prop: "status",
+      },
+      render(status) {
+        return statusData.value.find((x) => x.value == status).label;
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+              disabled: row.status != 30,
+            },
+            el: "button",
+            click() {
+              // 弹窗提示是否删除
+              ElMessageBox.confirm(
+                "此操作将永久作废该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
+                // 删除
+                proxy
+                  .post("/subscribeDetail/edit", {
+                    ...row,
+                    status: 99,
+                  })
+                  .then((res) => {
+                    ElMessage({
+                      message: "作废成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {
+    type: "1",
+  },
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "radio",
+      prop: "name",
+      label: "供应商类型",
+      required: true,
+      border: true,
+      data: [
+        { label: "贸易商", value: "1" },
+        { label: "工厂", value: "2" },
+      ],
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "供应商名称",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "address",
+      label: "地址",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "contact",
+      label: "联系信息",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "fileSlot",
+      label: "上传附件",
+    },
+    {
+      type: "input",
+      label: "备注",
+      prop: "remakes",
+      itemType: "textarea",
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/subscribeDetail/pageByWdly  ", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        ...JSON.parse(x.victoriatouristJson),
+      }));
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+
+const openModal = () => {
+  dialogVisible.value = true;
+};
+
+const submitForm = () => {
+  if (fileList.value.length > 0) {
+    byform.value.handleSubmit((valid) => {
+      formData.data.fileList = fileList.value;
+      submitLoading.value = true;
+      proxy.post("/productionProcesses/" + modalType.value, formData.data).then(
+        (res) => {
+          ElMessage({
+            message: modalType.value == "add" ? "添加成功" : "编辑成功",
+            type: "success",
+          });
+          fileList.value = [];
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => {
+          console.log(err, "aswwwww");
+          submitLoading.value = false;
+        }
+      );
+    });
+  } else {
+    return ElMessage({
+      message: "请上传附件!",
+      type: "info",
+    });
+  }
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
+    fileList.value = [
+      {
+        id: "",
+        fileName: res.fileName,
+        path: "",
+      },
+    ];
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+const handleBeforeUpload = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  fileList.value = [
+    {
+      id: res.id,
+      fileName: res.fileName,
+      path: res.fileUrl,
+    },
+  ];
+};
+const handleClickFile = (row) => {
+  ElMessage({
+    message: "数据请求中,请稍后!",
+    type: "success",
+  });
+  let id = row.id;
+  proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
+    const file = res[id][0];
+    window.open(file.fileUrl, "_blank");
+  });
+};
+
+const handlePreview = (file) => {
+  console.log(file);
+};
+const handleSuccess = (file) => {
+  console.log(file);
+};
+const handleRemove = (file) => {
+  fileList.value = [];
+};
+const handleClose = (index) => {
+  fileList.value.splice(index, 1);
+};
+const statusData = ref([
+  {
+    label: "审批中",
+    value: "10",
+  },
+  {
+    label: "待采购",
+    value: "15",
+  },
+  {
+    label: "部分采购",
+    value: "30",
+  },
+  {
+    label: "已采购",
+    value: "20",
+  },
+  {
+    label: "已作废",
+    value: "99",
+  },
+]);
+
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
+
+// selectConfig[1].data = statusData.value;
+getList();
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+:deep(.el-collapse-item__header) {
+  background-color: #fde6c8;
+  border: none;
+}
+:deep(.el-collapse-item__wrap) {
+  background-color: #fde6c8;
+  border: none;
+}
+
+.box {
+  padding: 15px;
+  background: #fde6c8;
+  border: 1px solid #7fb5e3;
+  .flex-box {
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
+    .item {
+      width: 50%;
+      div {
+        line-height: 22px;
+      }
+    }
+  }
+  .line {
+    width: 100%;
+    height: 1px;
+    background: #7fb5e3;
+    margin: 10px 0;
+  }
+  .bottom-arrow {
+    text-align: center;
+    cursor: pointer;
+    color: #0084ff;
+  }
+}
+</style>