Bladeren bron

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

lxf 2 jaren geleden
bovenliggende
commit
91c825df8d

+ 37 - 0
src/components/TitleInfo/index.vue

@@ -0,0 +1,37 @@
+<template>
+  <div class="title-info">
+    <div class="vertical-bar"></div>
+    <div class="content">{{ content }}</div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    content: String,
+    default: "",
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.title-info {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  height: 24px;
+  line-height: 24px;
+  .vertical-bar {
+    width: 3px;
+    height: 18px;
+    background-color: #0084ff;
+    margin-right: 7px;
+    margin-top: 1px;
+  }
+  .content {
+    font-size: 13px;
+    font-weight: 600;
+    color: #333333;
+  }
+}
+</style>

+ 8 - 4
src/components/WDLY/process/SendPurchaseWDLY.vue

@@ -171,7 +171,7 @@
             <template #default="{ row, $index }">
               <el-form-item
                 :prop="'otherFeeList.' + $index + '.name'"
-                :rules="rules.name"
+                :rules="rulesOne.name"
                 :inline-message="true"
               >
                 <el-input v-model="row.name" placeholder="请输入" />
@@ -181,8 +181,8 @@
           <el-table-column prop="price" label="金额" min-width="150">
             <template #default="{ row, $index }">
               <el-form-item
-                :prop="'purchaseDetailList.' + $index + '.price'"
-                :rules="rules.price"
+                :prop="'otherFeeList.' + $index + '.price'"
+                :rules="rulesOne.price"
                 :inline-message="true"
               >
                 <el-input-number
@@ -266,7 +266,7 @@ let rules = ref({
   ],
   supplyId: [{ required: true, message: "请选择供应商", trigger: "change" }],
   count: [{ required: true, message: "请输入本次采购数量", trigger: "blur" }],
-  price: [{ required: true, message: "请输入单价/金额", trigger: "blur" }],
+  price: [{ required: true, message: "请输入单价", trigger: "blur" }],
   remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
   isAgreement: [
     { required: true, message: "请选择是否合同", trigger: "change" },
@@ -275,6 +275,10 @@ let rules = ref({
     { required: true, message: "请选择付款方式", trigger: "change" },
   ],
 });
+let rulesOne = ref({
+  name: [{ required: true, message: "请输入费用名称", trigger: "blur" }],
+  price: [{ required: true, message: "请输入金额", trigger: "blur" }],
+});
 
 let openProduct = ref(false);
 const handleAdd = () => {

+ 21 - 11
src/components/WDLY/product/SelectProduct.vue

@@ -290,16 +290,7 @@ const selectConfig = computed(() => {
     {
       label: "产品类型",
       prop: "type",
-      data: [
-        {
-          label: "成品",
-          value: "1",
-        },
-        {
-          label: "半成品",
-          value: "2",
-        },
-      ],
+      data: [],
     },
     {
       label: "生命周期",
@@ -329,7 +320,7 @@ const config = computed(() => {
         prop: "type",
       },
       render(type) {
-        return type == 1 ? "成品" : type == 2 ? "半成品" : "";
+        return proxy.dictDataEcho(type, productType.value);
       },
     },
     {
@@ -807,6 +798,25 @@ const changeDay = (type) => {
 const handleSelect = (row) => {
   proxy.$emit("handleSelect", toRaw(row));
 };
+
+const productUnit = ref([]);
+const productType = ref([]);
+
+const getDict = () => {
+  proxy.getDict(["unit", "product_type"]).then((res) => {
+    productUnit.value = res["unit"];
+    productType.value = res["product_type"];
+    // formConfig.value[1].data = productType.value.map((x) => ({
+    //   label: x.dictValue,
+    //   value: x.dictKey,
+    // }));
+    selectConfig.value[0].data = productType.value.map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 </script>
   
 <style lang="scss" scoped>

+ 1 - 1
src/components/byForm/index.vue

@@ -158,7 +158,7 @@
           @change="(e) => commonsEmit(e, i)"
           :disabled="i.disabled ? i.disabled : false"
           :min="i.min ? i.min : 0"
-          :max="i.max ? i.max : 100"
+          :max="i.max ? i.max : 9999999999"
           :step="i.step ? i.step : 1"
           :precision="i.precision !== '' ? i.precision : 2"
           :controls="i.controls === false ? false : true"

+ 8 - 1
src/views/WDLY/basic/product/index.vue

@@ -742,6 +742,13 @@ const submitForm = () => {
         });
       }
     }
+    if (jsonObj.growUpDay <= Number(jsonObj.growUpDay1)) {
+      formData.data.victoriatouristJson = jsonObj;
+      return ElMessage({
+        message: "生命周期规则输入有误!",
+        type: "info",
+      });
+    }
     formData.data.victoriatouristJson = jsonObj;
     jsonObj.productCombinationList = list;
     jsonObj.combination = formData.data.combination;
@@ -907,7 +914,7 @@ const handleSelect = (row) => {
 let moveForm = ref({});
 let rowData = {};
 const getDtlOne = (row) => {
-  moveForm.value = {};
+  moveForm.value.deptId = row.deptId ? row.deptId.toString() : "";
   moveDept.value = true;
   rowData = row;
 };

+ 5 - 11
src/views/WDLY/basic/supplier/index.vue

@@ -235,16 +235,7 @@ const selectConfig = reactive([
   {
     label: "供应商类型",
     prop: "type",
-    data: [
-      {
-        label: "贸易商",
-        value: "1",
-      },
-      {
-        label: "工厂",
-        value: "2",
-      },
-    ],
+    data: [],
   },
   {
     label: "账期",
@@ -640,7 +631,10 @@ const supplierType = ref([]);
 const getDict = () => {
   proxy.getDict(["supplier_type"]).then((res) => {
     supplierType.value = res["supplier_type"];
-    console.log(res, "qsss");
+    selectConfig[0].data = supplierType.value.map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
   });
 };
 getDict();

+ 591 - 0
src/views/WDLY/outInBound/jdOrderReceive/index.vue

@@ -0,0 +1,591 @@
+<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: select,
+        }"
+        :action-list="[]"
+        @get-list="getList"
+      >
+        <template #code="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="handleClickCode(item)"
+          >
+            {{ item.code }}
+          </div>
+        </template>
+        <template #address="{ item }">
+          <div>
+            {{ item.countryName }}, {{ item.provinceName }} ,
+            {{ item.cityName }}
+          </div>
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '京东订单接收' : '调仓接收'"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #distributionCenter>
+          <div>
+            <el-autocomplete
+              v-model="formData.data.distributionCenter"
+              :fetch-suggestions="querySearchPerson"
+              clearable
+              class="inline-input w-50"
+              placeholder="请输入"
+              :disabled="true"
+            >
+            </el-autocomplete>
+          </div>
+        </template>
+        <template #address>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-form-item prop="countryId">
+                <el-select
+                  v-model="formData.data.countryId"
+                  placeholder="国家"
+                  @change="(val) => getCityData(val, '20', true)"
+                  :disabled="true"
+                >
+                  <el-option
+                    v-for="item in countryData"
+                    :label="item.chineseName"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="provinceId">
+                <el-select
+                  v-model="formData.data.provinceId"
+                  placeholder="省/洲"
+                  @change="(val) => getCityData(val, '30', true)"
+                  :disabled="true"
+                >
+                  <el-option
+                    v-for="item in provinceData"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="cityId">
+                <el-select
+                  v-model="formData.data.cityId"
+                  placeholder="城市"
+                  :disabled="true"
+                >
+                  <el-option
+                    v-for="item in cityData"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row style="margin-top: 20px; width: 100%">
+            <el-col :span="24">
+              <el-form-item prop="detailedAddress">
+                <el-input
+                  v-model="formData.data.detailedAddress"
+                  type="textarea"
+                  :disabled="true"
+                >
+                </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </template>
+        <template #products>
+          <div style="width: 100%">
+            <el-table :data="formData.data.jdOrderDetailsList">
+              <el-table-column prop="productCode" label="物品编码" />
+              <el-table-column prop="productName" label="物品名称" />
+              <el-table-column prop="productName" label="规格型号" />
+              <el-table-column prop="productName" label="调仓数量" />
+              <el-table-column prop="quantity" label="接收数量" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'jdOrderDetailsList.' + $index + '.quantity'"
+                    :rules="rules.quantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.quantity"
+                      :precision="4"
+                      :controls="false"
+                      :min="0"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <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>
+
+    <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>
+  
+<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 OrderDetails from "@/components/WDLY/order/details";
+
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let openDetails = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  customerId: [
+    {
+      required: true,
+      message: "请选择客户",
+      trigger: "change",
+    },
+  ],
+  type: [
+    {
+      required: true,
+      message: "请选择订单类型",
+      trigger: "change",
+    },
+  ],
+  countryId: [
+    {
+      required: true,
+      message: "请选择国家",
+      trigger: "change",
+    },
+  ],
+  provinceId: [
+    {
+      required: true,
+      message: "请选择省/洲",
+      trigger: "change",
+    },
+  ],
+  cityId: [
+    {
+      required: true,
+      message: "请选择城市",
+      trigger: "change",
+    },
+  ],
+  code: [
+    {
+      required: true,
+      message: "请输入订单编号",
+      trigger: "blur",
+    },
+  ],
+  contactPerson: [
+    {
+      required: true,
+      message: "请输入收货负责人",
+      trigger: "blur",
+    },
+  ],
+  contactNumber: [
+    {
+      required: true,
+      message: "请输入收货电话",
+      trigger: "blur",
+    },
+  ],
+  detailedAddress: [
+    {
+      required: true,
+      message: "请输入详细地址",
+      trigger: "blur",
+    },
+  ],
+  price: [
+    {
+      required: true,
+      message: "请输入单价",
+      trigger: "blur",
+    },
+  ],
+  quantity: [
+    {
+      required: true,
+      message: "请输入数量",
+      trigger: "blur",
+    },
+  ],
+  distributionCenter: [
+    {
+      required: true,
+      message: "请输入/选择配送中心",
+      trigger: "blur",
+    },
+  ],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "接收状态",
+    prop: "status",
+    data: [
+      {
+        label: "未出库",
+        value: "1",
+      },
+      {
+        label: "部分出库",
+        value: "2",
+      },
+      {
+        label: "已出库",
+        value: "3",
+      },
+    ],
+  },
+]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "订单订单编号",
+        prop: "code",
+        slot: "code",
+      },
+    },
+
+    {
+      attrs: {
+        label: "配送中心",
+        prop: "distributionCenter",
+      },
+    },
+    {
+      attrs: {
+        label: "所在城市",
+        prop: "address",
+        slot: "address",
+        width: "150",
+      },
+    },
+    {
+      attrs: {
+        label: "详细地址",
+        prop: "detailedAddress",
+        width: "300",
+      },
+    },
+    {
+      attrs: {
+        label: "收货负责人",
+        prop: "contactPerson",
+      },
+    },
+    {
+      attrs: {
+        label: "收货电话",
+        prop: "contactNumber",
+        width: "180",
+      },
+    },
+
+    {
+      attrs: {
+        label: "接收人",
+        prop: "status",
+      },
+    },
+    {
+      attrs: {
+        label: "接收时间",
+        prop: "status",
+      },
+    },
+    {
+      attrs: {
+        label: "接收状态",
+        prop: "status",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "接收",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              openModal();
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+  orderData: {},
+});
+const formOption = reactive({
+  disabled: false,
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "订单信息",
+  },
+  {
+    type: "select",
+    prop: "customerId",
+    label: "客户名称",
+    isLoad: {
+      url: "/customer/page",
+      req: {
+        pageNum: 1,
+        pageSize: 9999,
+      },
+      labelKey: "name",
+      labelVal: "id",
+      method: "post",
+      resUrl: "rows",
+    },
+    itemWidth: 30,
+    disabled: true,
+  },
+  {
+    type: "input",
+    prop: "code",
+    label: "订单编号",
+    itemWidth: 20,
+    disabled: true,
+  },
+  {
+    type: "slot",
+    prop: "distributionCenter",
+    label: "配送中心",
+    slotName: "distributionCenter",
+    disabled: true,
+  },
+  {
+    type: "input",
+    prop: "contactPerson",
+    label: "收货信息",
+    itemWidth: 20,
+    placeholder: "收货负责人",
+    disabled: true,
+  },
+  {
+    type: "input",
+    prop: "contactNumber",
+    label: " ",
+    itemWidth: 30,
+    placeholder: "收货电话",
+    disabled: true,
+  },
+  {
+    type: "slot",
+    slotName: "address",
+    prop: "countryId",
+    label: "详细地址",
+    required: true,
+    disabled: true,
+  },
+  {
+    type: "title",
+    title: "调仓明细",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/jdOrder/page", sourceList.value.pagination).then((message) => {
+    console.log(message);
+    sourceList.value.data = message.rows;
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {
+    jdOrderDetailsList: [{}],
+    countryId: "China",
+  };
+  getCityData(formData.data.countryId, "20");
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    const list = formData.data.jdOrderDetailsList;
+    if (!list.length > 0)
+      return ElMessage({
+        message: `请添加订单明细!`,
+        type: "info",
+      });
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      if (e.quantity == 0) {
+        return ElMessage({
+          message: `数量不能为0!`,
+          type: "info",
+        });
+      }
+    }
+    submitLoading.value = true;
+    proxy.post("/jdOrder/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const warehouseList = ref([]);
+const salesType = ref([]);
+
+const getDict = () => {
+  proxy.getDict(["order_sales_type"]).then((res) => {
+    salesType.value = res["order_sales_type"];
+    formConfig[1].data = salesType.value.map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+
+const getCityData = (id, type, isChange) => {
+  proxy.post("/areaInfo/list", { parentId: id }).then((res) => {
+    if (type === "20") {
+      provinceData.value = res;
+      if (isChange) {
+        formData.data.provinceId = "";
+        formData.data.cityId = "";
+      }
+    } else if (type === "30") {
+      cityData.value = res;
+      if (isChange) {
+        formData.data.cityId = "";
+      }
+    } else {
+      countryData.value = res;
+    }
+  });
+};
+getCityData("0");
+getList();
+// getDict();
+
+const handleClickCode = (row) => {
+  // formData.orderData = row;
+  // openDetails.value = true;
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 33 - 37
src/views/WDLY/outInBound/logistics/index.vue

@@ -312,17 +312,19 @@ const config = computed(() => {
               editStatus(row);
             },
           },
-          {
-            attrs: {
-              label: "到货通知",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              handleArrival(row);
-            },
-          },
+          row.businessType == 1
+            ? {
+                attrs: {
+                  label: "到货通知",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handleArrival(row);
+                },
+              }
+            : {},
         ];
       },
     },
@@ -384,6 +386,10 @@ const formConfig = reactive([
 ]);
 const formConfigOne = reactive([
   {
+    type: "title",
+    title: "基础信息",
+  },
+  {
     type: "input",
     prop: "supplyName",
     label: "供应商",
@@ -442,6 +448,7 @@ const submitForm = () => {
   byform.value.handleSubmit((valid) => {
     if (modalType.value == "other") {
       loading.value = true;
+      submitLoading.value = true;
       formData.data.arrivalDetailList = formData.data.arrivalDetailList.map(
         (x) => ({
           bussinessId: x.bussinessId,
@@ -456,16 +463,20 @@ const submitForm = () => {
         code: formData.data.code,
       };
       formData.data.victoriatouristJson = JSON.stringify(victoriatouristJson);
-      proxy.post("/arrival/addByWdly", formData.data).then((res) => {
-        ElMessage({
-          message: `操作成功!`,
-          type: "success",
-        });
-        dialogVisible.value = false;
-        loading.value = false;
-        getList();
-      });
+      proxy.post("/arrival/addByWdly", formData.data).then(
+        (res) => {
+          ElMessage({
+            message: `操作成功!`,
+            type: "success",
+          });
+          dialogVisible.value = false;
+          loading.value = false;
+          getList();
+        },
+        (err) => (submitLoading.value = false)
+      );
     } else {
+      loading.value = true;
       submitLoading.value = true;
       proxy.post("/logisticsInfos/" + modalType.value, formData.data).then(
         (res) => {
@@ -529,7 +540,6 @@ const getLogisticsData = (row) => {
     }));
   });
 };
-
 const handleClickCode = (row) => {
   let id = row.id;
   proxy.post("/logisticsInfos/getLogistics", { id }).then((res) => {
@@ -544,6 +554,7 @@ const handleClickCode = (row) => {
     }
   });
 };
+
 const deliverData = ref([]);
 const handleArrival = (row) => {
   modalType.value = "other";
@@ -555,7 +566,7 @@ const handleArrival = (row) => {
       supplyId: row.supplyId,
       code: row.code,
       logisticsCompanyCode: row.logisticsCompanyCode,
-      deliverGoodsId: row.deliverGoodsId,
+      deliverGoodsId: res[0] ? res[0].deliverGoodsId : "",
       arrivalDetailList: res.map((x) => ({
         count: x.count,
         productName: x.name,
@@ -574,21 +585,6 @@ const handleArrival = (row) => {
   });
 };
 
-// watch(
-//   () => formData.data.deliverGoodsId,
-//   (val) => {
-//     if (val) {
-//       const current = deliverData.value.find((x) => x.id === val);
-//       formData.data.logisticsCompanyCode = current
-//         ? current.logisticsCompanyCode
-//         : "";
-//       formData.data.code = current ? current.code : "";
-//       // formData.data.logisticsCompanyName = current ? current.logisticsCompanyCode : "";
-
-//     }
-//   }
-// );
-
 getList();
 getLogisticsData();
 onMounted(() => {

+ 44 - 26
src/views/WDLY/outInBound/waitInBound/index.vue

@@ -16,8 +16,15 @@
         :action-list="[]"
         @get-list="getList"
       >
-        <template #slotName="{ item }">
-          {{ item.createTime }}
+        <template #code="{ item }">
+          <div style="cursor: pointer; color: #409eff">
+            {{ item.businessCode }}
+          </div>
+        </template>
+        <template #logistics="{ item }">
+          {{ item.logisticsCompanyName }} (
+          <span style="cursor: pointer; color: #409eff"> {{ item.code }} </span>
+          )
         </template>
       </byTable>
     </div>
@@ -26,6 +33,7 @@
       v-model="dialogVisible"
       width="800"
       v-loading="loading"
+      destroy-on-close
     >
       <byForm
         :formConfig="formConfig"
@@ -37,8 +45,8 @@
         <template #detail>
           <div style="width: 100%">
             <el-table :data="formData.data.stockWaitDetailsList">
-              <el-table-column prop="productCode" label="品编码" />
-              <el-table-column prop="productName" label="品名称" />
+              <el-table-column prop="productCode" label="品编码" />
+              <el-table-column prop="productName" label="品名称" />
               <el-table-column prop="purchaseQuantity" label="采购数量" />
               <el-table-column prop="arrivalQuantity" label="本次发货" />
               <el-table-column prop="receiptQuantity" label="已入库" />
@@ -112,7 +120,7 @@ const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
     label: "入库状态",
-    prop: "type",
+    prop: "status",
     data: [],
   },
 ]);
@@ -145,13 +153,15 @@ const config = computed(() => {
       attrs: {
         label: "单号",
         prop: "code",
+        slot: "code",
       },
     },
 
     {
       attrs: {
-        label: "物流/快递公司",
+        label: "物流/快递信息",
         prop: "logisticsCompanyName",
+        slot: "logistics",
       },
     },
     {
@@ -178,7 +188,7 @@ const config = computed(() => {
         prop: "status",
       },
       render(status) {
-        return status == 0 ? "未入库" : status == 1 ? "部分入库" : "";
+        return status == 0 ? "未入库" : status == 1 ? "部分入库" : "入库完成";
       },
     },
     {
@@ -190,18 +200,19 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "入库",
-              type: "primary",
-              text: true,
-              disabled: row.status > 1,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
+          row.status < 2
+            ? {
+                attrs: {
+                  label: "入库",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              }
+            : {},
         ];
       },
     },
@@ -222,6 +233,10 @@ const byform = ref(null);
 const treeData = ref([]);
 const formConfig = reactive([
   {
+    type: "title",
+    title: "基础信息",
+  },
+  {
     type: "select",
     prop: "businessType",
     label: "入库类型",
@@ -322,12 +337,15 @@ const submitForm = () => {
 const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/stockWait/detailByWdly", { id: row.id }).then((res) => {
-    const json = JSON.parse(res.victoriatouristJson);
+    const json = res.victoriatouristJson
+      ? JSON.parse(res.victoriatouristJson)
+      : {};
     formData.data = {
+      id: row.id,
       type: "1",
-      businessType: res.businessType,
+      businessType: res.businessType + "",
       warehouseId: "",
-      code: json.code,
+      code: json.code ? json.code : "",
       stockWaitDetailsList: res.stockWaitDetailsList.map((x) => ({
         ...x,
         arrivalQuantity: x.quantity,
@@ -349,10 +367,6 @@ const getDict = () => {
     })
     .then((res) => {
       warehouseType.value = res.rows;
-      formConfig[0].data = res.rows.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
     });
 };
 
@@ -367,6 +381,10 @@ getList();
 getDict();
 onMounted(() => {
   selectConfig[0].data = inboundType.value;
+  formConfig[1].data = businessType.map((x) => ({
+    label: x.label,
+    value: x.value,
+  }));
 });
 </script>
   

+ 398 - 0
src/views/WDLY/outInBound/waitOutBound/index.vue

@@ -0,0 +1,398 @@
+<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: select,
+        }"
+        :action-list="[]"
+        @get-list="getList"
+      >
+        <template #slotName="{ item }">
+          {{ item.createTime }}
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      title="出库"
+      v-model="dialogVisible"
+      width="500"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+      </byForm>
+      <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 { computed, defineComponent, ref } from "vue";
+import useUserStore from "@/store/modules/user";
+
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: 1,
+  },
+});
+let dialogVisible = ref(false);
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  type: [
+    { required: true, message: "请选择仓库类型", trigger: ["blur", "change"] },
+  ],
+  warehouseId: [
+    { required: true, message: "请选择仓库名称", trigger: "change" },
+  ],
+  quantity: [{ required: true, message: "请输入入库数量", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "数据来源",
+    prop: "type",
+    data: [],
+  },
+  {
+    label: "出库状态",
+    prop: "type",
+    data: [],
+  },
+]);
+const inboundType = ref([
+  {
+    label: "未入库",
+    value: "0",
+  },
+  {
+    label: "部分入库",
+    value: "1",
+  },
+  {
+    label: "入库完成",
+    value: "2",
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "数据来源",
+        prop: "businessType",
+      },
+      render(type) {
+        return businessType.find((x) => x.value == type).label;
+      },
+    },
+    {
+      attrs: {
+        label: "单号",
+        prop: "code",
+      },
+    },
+
+    {
+      attrs: {
+        label: "物品类型",
+        prop: "logisticsCompanyName",
+      },
+    },
+    {
+      attrs: {
+        label: "物品编码",
+        prop: "receiptWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "物品名称",
+        prop: "operatorName",
+      },
+    },
+    {
+      attrs: {
+        label: "型号规格",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "待出库",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "出库状态",
+        prop: "status",
+      },
+      render(status) {
+        return status == 0 ? "未入库" : status == 1 ? "部分入库" : "";
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "出库",
+              type: "primary",
+              text: true,
+              disabled: row.status > 1,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "待出库信息",
+  },
+  {
+    type: "select",
+    prop: "businessType",
+    label: "数据来源",
+    required: true,
+    disabled: true,
+    itemWidth: 100,
+    data: [],
+  },
+  {
+    type: "input",
+    prop: "businessType",
+    label: "单号",
+    required: true,
+    disabled: true,
+    itemWidth: 100,
+    data: [],
+  },
+  {
+    type: "input",
+    prop: "businessType",
+    label: "物品名称",
+    required: true,
+    disabled: true,
+    itemWidth: 100,
+    data: [],
+  },
+  {
+    type: "input",
+    prop: "businessType",
+    label: "待出库数量",
+    required: true,
+    disabled: true,
+    itemWidth: 40,
+    data: [],
+  },
+  {
+    type: "title",
+    title: "本次出库",
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "仓库名称",
+    itemWidth: 100,
+    isLoad: {
+      url: "/warehouse/page",
+      req: {
+        pageNum: 1,
+        pageSize: 9999,
+      },
+      labelKey: "name",
+      labelVal: "id",
+      method: "post",
+      resUrl: "rows",
+    },
+  },
+  {
+    type: "input",
+    prop: "code",
+    label: "出库数量",
+    disabled: false,
+    itemWidth: 33,
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/stockWait/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;
+  modalType.value = "add";
+  formData.data = {};
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    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("/stockWait/addByWdly", formData.data).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  // 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([]);
+const getDict = () => {
+  // // 币种数据
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: useUserStore().user.tenantId,
+      dictCode: "warehouse_type",
+    })
+    .then((res) => {
+      warehouseType.value = res.rows;
+      formConfig[0].data = res.rows.map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+    });
+};
+
+const businessType = [
+  { label: "线边回仓", value: "1" },
+  { label: "完工入库", value: "2" },
+  { label: "采购到货", value: "3" },
+  { label: "退货出库", value: "4" },
+];
+
+getList();
+getDict();
+onMounted(() => {
+  selectConfig[0].data = inboundType.value;
+});
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 66 - 38
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -30,6 +30,7 @@
       v-model="dialogVisible"
       width="800"
       v-loading="loading"
+      destroy-on-close
     >
       <byForm
         :formConfig="formConfig"
@@ -48,10 +49,18 @@
               "
             >
               <el-table-column
-                prop="productType"
+                prop="definition"
                 label="物品类型"
-                :formatter="(row) => (row.productType == 1 ? '产品' : '物料')"
+                :formatter="
+                  (row) =>
+                    row.definition == 1
+                      ? '产品'
+                      : row.definition == 2
+                      ? '物料'
+                      : ''
+                "
               />
+
               <el-table-column prop="productCode" label="物品编码" />
               <el-table-column prop="productName" label="物品名称" />
               <el-table-column prop="productSpec" label="规格型号" />
@@ -148,42 +157,52 @@ let rules = ref({
   ],
 });
 const { proxy } = getCurrentInstance();
+const arrivalStatus = [
+  {
+    label: "未到货",
+    value: "0",
+  },
+  {
+    label: "部分到货",
+    value: "1",
+  },
+  {
+    label: "已到货",
+    value: "2",
+  },
+];
+const statusData = ref([
+  {
+    label: "审批中",
+    value: "10",
+  },
+  {
+    label: "待采购",
+    value: "15",
+  },
+  {
+    label: "部分采购",
+    value: "30",
+  },
+  {
+    label: "已采购",
+    value: "20",
+  },
+  {
+    label: "已作废",
+    value: "99",
+  },
+]);
 const selectConfig = reactive([
   {
     label: "采购状态",
     prop: "purchaseStatus",
-    data: [
-      {
-        label: "审批中",
-        value: "10",
-      },
-      {
-        label: "已驳回",
-        value: "20",
-      },
-      {
-        label: "已采购",
-        value: "30",
-      },
-    ],
+    data: statusData.value,
   },
   {
     label: "到货状态",
     prop: "arrivalStatus",
-    data: [
-      {
-        label: "未到货",
-        value: "0",
-      },
-      {
-        label: "部分到货",
-        value: "10",
-      },
-      {
-        label: "已到货",
-        value: "20",
-      },
-    ],
+    data: arrivalStatus,
   },
   {
     label: "付款状态",
@@ -250,12 +269,19 @@ const config = computed(() => {
         label: "采购状态",
         prop: "purchaseStatus",
       },
+      render(status) {
+        const current = statusData.value.find((x) => x.value == status);
+        if (current) return current.label;
+      },
     },
     {
       attrs: {
         label: "到货状态",
         prop: "arrivalStatus",
       },
+      render(status) {
+        return arrivalStatus.find((x) => x.value == status).label;
+      },
     },
     {
       attrs: {
@@ -413,14 +439,16 @@ const deliverData = ref([]);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/purchase/page", sourceList.value.pagination).then((message) => {
-    console.log(message);
-    sourceList.value.data = message.rows;
-    sourceList.value.pagination.total = message.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/purchase/pageByWdly", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 
 const submitForm = () => {

+ 136 - 185
src/views/WDLY/purchaseManage/arrival/index.vue

@@ -38,102 +38,69 @@
       width="800"
       v-loading="loading"
     >
-      <el-form
-        :model="formData.data"
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
         :rules="rules"
-        ref="formDom"
-        label-position="top"
+        ref="byform"
       >
-        <div style="margin-bottom: 10px; font-size: 14px">基础信息</div>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="供应商" prop="supplyId">
-              <el-select
-                v-model="formData.data.supplyId"
-                placeholder="请选择"
-                style="width: 100%"
-                disabled
+        <template #products>
+          <div style="width: 100%">
+            <el-table :data="formData.data.stockTransferDetailsList">
+              <el-table-column prop="productCode" label="物品类型" />
+              <el-table-column prop="productCode" label="物品编码" />
+              <el-table-column prop="productName" label="物品名称" />
+              <el-table-column prop="productSpec" label="规格型号" />
+              <el-table-column prop="productSpec" label="单位" />
+              <el-table-column prop="inQuantity" label="到货数量" />
+              <el-table-column prop="outQuantity" label="已质检" />
+              <el-table-column
+                prop="outQuantity"
+                label="质检合格"
+                min-width="150"
               >
-                <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-row>
-          <el-col :span="6">
-            <el-form-item label="采购单号" prop="code">
-              <el-input
-                v-model="formData.data.code"
-                placeholder="请输入"
-                disabled
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="
+                      'stockTransferDetailsList.' + $index + '.outQuantity'
+                    "
+                    :rules="rules.outQuantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.outQuantity"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="inQuantity"
+                label="质检不合格"
+                min-width="150"
               >
-              </el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <div style="margin-bottom: 10px; font-size: 14px">到货明细</div>
-        <el-form-item>
-          <el-table :data="formData.data.qualityDetailList">
-            <el-table-column
-              prop="productType"
-              label="货品类型"
-              :formatter="(row) => (row.productType == 1 ? '产品' : '物料')"
-            />
-            <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="到货数量" />
-            <el-table-column prop="sumQualityCount" label="已质检" />
-            <el-table-column
-              prop="qualifiedCount"
-              label="质检合格"
-              min-width="150"
-            >
-              <template #default="{ row, $index }">
-                <el-form-item
-                  :prop="'qualityDetailList.' + $index + '.qualifiedCount'"
-                  :rules="rules.qualifiedCount"
-                  :inline-message="true"
-                >
-                  <el-input-number
-                    v-model="row.qualifiedCount"
-                    :precision="4"
-                    :controls="false"
-                    :min="0"
-                  />
-                </el-form-item>
-              </template>
-            </el-table-column>
-            <el-table-column
-              prop="noQualifiedCount"
-              label="质检不合格"
-              min-width="150"
-            >
-              <template #default="{ row, $index }">
-                <el-form-item
-                  :prop="'qualityDetailList.' + $index + '.noQualifiedCount'"
-                  :rules="rules.noQualifiedCount"
-                  :inline-message="true"
-                >
-                  <el-input-number
-                    v-model="row.noQualifiedCount"
-                    :precision="4"
-                    :controls="false"
-                    :min="0"
-                  />
-                </el-form-item>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-      </el-form>
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockTransferDetailsList.' + $index + '.inQuantity'"
+                    :rules="rules.inQuantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.inQuantity"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
         <el-button
@@ -150,17 +117,9 @@
 </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, watch } 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({
@@ -173,7 +132,6 @@ const sourceList = ref({
 });
 let dialogVisible = ref(false);
 let modalType = ref("add");
-let fileList = ref([]);
 let rules = ref({
   name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
   qualifiedCount: [
@@ -214,7 +172,7 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "到货单号",
+        label: "采购单号",
         prop: "code",
       },
     },
@@ -226,71 +184,36 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "物品类型",
+        label: "物流/快递公司",
         prop: "productType",
       },
-      render(type) {
-        return type == 1 ? "产品" : type == 2 ? "物料" : "";
-      },
     },
 
     {
       attrs: {
-        label: "物品编码",
+        label: "物流/快递单号",
         prop: "productCode",
       },
     },
     {
       attrs: {
-        label: "物品名称",
+        label: "采购员",
         prop: "productName",
       },
     },
     {
       attrs: {
-        label: "规格型号",
+        label: "采购时间",
         prop: "productSpec",
       },
     },
     {
       attrs: {
-        label: "单位",
-        prop: "productUnit",
-      },
-    },
-    {
-      attrs: {
-        label: "到货数量",
-        prop: "count",
-      },
-    },
-    {
-      attrs: {
-        label: "质检合格",
-        prop: "qualifiedCount",
-      },
-    },
-    {
-      attrs: {
-        label: "质检不合格",
-        prop: "noQualifiedCount",
-      },
-    },
-    {
-      attrs: {
         label: "质检状态",
-        prop: "status",
-      },
-      render(type) {
-        return type == 0
-          ? "未质检"
-          : type == 10
-          ? "部分质检"
-          : type == 20
-          ? "已质检"
-          : "";
+        prop: "productUnit",
       },
     },
+
     {
       attrs: {
         label: "操作",
@@ -300,19 +223,20 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "质检",
-              type: "primary",
-              text: true,
-              disabled: row.status == 20,
-            },
-            el: "button",
-            click() {
-              selectDataOne.value = [row];
-              start(10);
-            },
-          },
+          row.status == 20
+            ? {
+                attrs: {
+                  label: "质检",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  selectDataOne.value = [row];
+                  start(10);
+                },
+              }
+            : {},
         ];
       },
     },
@@ -328,9 +252,44 @@ const formOption = reactive({
   itemWidth: 100,
   rules: [],
 });
-const formConfig = computed(() => {});
-const formDom = ref(null);
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "到货信息",
+  },
+  {
+    type: "select",
+    prop: "outWarehouseId",
+    label: "供应商",
+    disabled: true,
+  },
+  {
+    type: "select",
+    prop: "inWarehouseId",
+    label: "物流快递信息",
+    placeholder: "物流/快递公司",
+    itemWidth: 20,
+    disabled: true,
+  },
+  {
+    type: "input",
+    prop: "remark",
+    label: " ",
+    itemWidth: 30,
+    placeholder: "物流/快递单号",
+    disabled: true,
+  },
+  {
+    type: "title",
+    title: "质检明细",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+]);
 
+const byform = ref(null);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -353,7 +312,7 @@ const getList = async (req) => {
 };
 
 const submitForm = () => {
-  formDom.value.validate((valid) => {
+  byform.value.handleSubmit((valid) => {
     const list = formData.data.qualityDetailList;
     for (let i = 0; i < list.length; i++) {
       const e = list[i];
@@ -394,15 +353,7 @@ const submitForm = () => {
 const getDtl = (row) => {
   modalType.value = "edit";
   dialogVisible.value = true;
-
   // proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
-  //   fileList.value = [
-  //     {
-  //       id: "",
-  //       fileName: res.fileName,
-  //       path: "",
-  //     },
-  //   ];
   //   formData.data = res;
   //   dialogVisible.value = true;
   // });
@@ -444,24 +395,24 @@ const start = (type) => {
   });
 };
 
-watch(selectData, (newVal, oldVal) => {
-  if (newVal.length == 0) {
-    sourceList.value.data.forEach((x) => {
-      if (x.status < 20) {
-        x.isCheck = true;
-      } else {
-        x.isCheck = false;
-      }
-    });
-  } else if (newVal.length == 1) {
-    const current = newVal[0];
-    sourceList.value.data.forEach((x) => {
-      if (x.arrivalId !== current.arrivalId || x.status == 20) {
-        x.isCheck = false;
-      }
-    });
-  }
-});
+// watch(selectData, (newVal, oldVal) => {
+//   if (newVal.length == 0) {
+//     sourceList.value.data.forEach((x) => {
+//       if (x.status < 20) {
+//         x.isCheck = true;
+//       } else {
+//         x.isCheck = false;
+//       }
+//     });
+//   } else if (newVal.length == 1) {
+//     const current = newVal[0];
+//     sourceList.value.data.forEach((x) => {
+//       if (x.arrivalId !== current.arrivalId || x.status == 20) {
+//         x.isCheck = false;
+//       }
+//     });
+//   }
+// });
 
 onMounted(() => {});
 </script>

+ 9 - 6
src/views/WDLY/purchaseManage/purchase/index.vue

@@ -182,7 +182,7 @@ const selectConfig = reactive([
   },
   {
     label: "收获仓库",
-    prop: "receiptWarehouseName",
+    prop: "receiptWarehouseId",
     data: [],
   },
 ]);
@@ -202,11 +202,11 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "品类型",
-        prop: "productType",
+        label: "品类型",
+        prop: "definition",
       },
-      render(productType) {
-        return productType == 1 ? "产品" : "物料";
+      render(definition) {
+        return definition == 1 ? "产品" : definition == 1 ? "物料" : "";
       },
     },
 
@@ -244,12 +244,14 @@ const config = computed(() => {
       attrs: {
         label: "收货仓库",
         prop: "receiptWarehouseName",
+        width: 130,
       },
     },
     {
       attrs: {
         label: "要求到货时间",
         prop: "planArrivalTime",
+        width: 130,
       },
     },
     {
@@ -271,12 +273,13 @@ const config = computed(() => {
       attrs: {
         label: "申购时间",
         prop: "subcribeTime",
+        width: 155,
       },
     },
     {
       attrs: {
         label: "操作",
-        width: "200",
+        width: "80",
         align: "right",
       },
       // 渲染 el-button,一般用在最后一列。

+ 39 - 37
src/views/WDLY/purchaseManage/subscribe/index.vue

@@ -196,10 +196,10 @@ const config = computed(() => {
     {
       attrs: {
         label: "货品类型",
-        prop: "productType",
+        prop: "definition",
       },
-      render(productType) {
-        return productType == 1 ? "产品" : "物料";
+      render(definition) {
+        return definition == 1 ? "产品" : definition == 1 ? "物料" : "";
       },
     },
     {
@@ -292,41 +292,43 @@ const config = computed(() => {
           //     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();
+          row.status == 30
+            ? {
+                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();
+                      });
                   });
-              });
-            },
-          },
+                },
+              }
+            : {},
         ];
       },
     },

+ 175 - 86
src/views/WDLY/stockManage/query/index.vue

@@ -11,6 +11,7 @@
       >
         <el-tab-pane label="按仓库" name="first"></el-tab-pane>
         <el-tab-pane label="按产品" name="second"></el-tab-pane>
+        <el-tab-pane label="按SPU" name="three"></el-tab-pane>
       </el-tabs>
       <byTable
         :source="sourceList.data"
@@ -83,102 +84,157 @@ let openProduct = ref(false);
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  qualified: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
-  // {
-  //   label: "spu类型",
-  //   prop: "type",
-  //   data: [],
-  // },
-]);
-
-const config = reactive([
   {
-    attrs: {
-      label: "仓库名称",
-      prop: "warehouseName",
-    },
+    label: "仓库名称",
+    prop: "id",
+    data: [],
   },
   {
-    attrs: {
-      label: "产品编码",
-      prop: "code",
-    },
+    label: "物品类型",
+    prop: "definition",
+    data: [
+      {
+        label: "产品",
+        value: "1",
+      },
+      {
+        label: "物料",
+        value: "2",
+      },
+    ],
   },
-  {
-    attrs: {
-      label: "产品名称",
-      prop: "productName",
+]);
+
+const config = ref([]);
+
+const configData = [
+  [
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "规格",
-      prop: "spec",
+    {
+      attrs: {
+        label: "所属分类",
+        prop: "productClassifyName",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "单位",
-      prop: "unit",
+    {
+      attrs: {
+        label: "物品编码",
+        prop: "productCode",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "可用库存",
-      prop: "quantity",
+    {
+      attrs: {
+        label: "物品名称",
+        prop: "productName",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "冻结库存",
-      prop: "frozenQuantity",
+    {
+      attrs: {
+        label: "规格",
+        prop: "productSpec",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "次品",
-      prop: "defectiveQuantity",
+    {
+      attrs: {
+        label: "单位",
+        prop: "productUnit",
+      },
     },
-  },
-  {
-    attrs: {
-      label: "操作",
-      width: "200",
-      align: "right",
+    {
+      attrs: {
+        label: "可用库存",
+        prop: "quantity",
+      },
     },
-    // 渲染 el-button,一般用在最后一列。
-    renderHTML(row) {
-      return [
-        {
-          attrs: {
-            label: "良转次",
-            type: "primary",
-            text: true,
-          },
-          el: "button",
-          click() {
-            getDtl(row, "add");
-          },
-        },
-        {
-          attrs: {
-            label: "次转良",
-            type: "primary",
-            text: true,
+    {
+      attrs: {
+        label: "冻结库存",
+        prop: "frozenQuantity",
+      },
+    },
+    {
+      attrs: {
+        label: "次品库存",
+        prop: "defectiveQuantity",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "良转次",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "add");
+            },
           },
-          el: "button",
-          click() {
-            getDtl(row, "edit");
+          {
+            attrs: {
+              label: "次转良",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "edit");
+            },
           },
-        },
-      ];
+        ];
+      },
     },
-  },
-]);
-
+  ],
+  [
+    {
+      attrs: {
+        label: "spu编码",
+        prop: "warehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "spu名称",
+        prop: "productClassifyName",
+      },
+    },
+    {
+      attrs: {
+        label: "关联产品数",
+        prop: "productCode",
+      },
+    },
+    {
+      attrs: {
+        label: "库存数量",
+        prop: "productName",
+      },
+    },
+    {
+      attrs: {
+        label: "可组合数量",
+        prop: "productSpec",
+      },
+    },
+  ],
+];
 let formData = reactive({
   data: {},
   treeData: [],
@@ -199,7 +255,7 @@ const formConfig = reactive([
   },
   {
     type: "input",
-    prop: "qualified",
+    prop: "quantity",
     label: "数量",
   },
 ]);
@@ -226,9 +282,9 @@ const submitForm = () => {
   let submitAddress =
     modalType.value === "add"
       ? "/stock/defectiveToQualified"
-      : "/stock/qualifiedToDefective";
+      : "/stock/quantityToDefective";
   byform.value.handleSubmit((valid) => {
-    if (Number(formData.data.qualified) > Number(formData.data.canSum)) {
+    if (Number(formData.data.quantity) > Number(formData.data.canSum)) {
       return ElMessage({
         message: "不可大于可转数量!",
         type: "info",
@@ -256,29 +312,62 @@ const getDtl = (row, type) => {
   formData.data = {
     id: row.id,
     canSum,
-    qualified: "",
+    quantity: "",
   };
   dialogVisible.value = true;
 };
-
+config.value = configData[0];
 getList();
 
 const handleChange = () => {
   sourceList.value.pagination.pageNum = 1;
   if (activeName.value === "first") {
     requestUrl = "/stock/pageByWarehouse";
-    config.unshift({
+    config.value = configData[0];
+    config.value.unshift({
       attrs: {
         label: "仓库名称",
         prop: "warehouseName",
       },
     });
+    selectConfig.unshift({
+      label: "仓库名称",
+      prop: "type",
+      data: warehouseList.value.map((x) => ({
+        label: x.name,
+        value: x.id,
+      })),
+    });
+  } else if (activeName.value === "second") {
+    requestUrl = "/stock/pageByProduct";
+    config.value = configData[0];
+    if (selectConfig.length > 1) selectConfig.shift();
+    config.value.shift();
   } else {
     requestUrl = "/stock/pageByProduct";
-    config.shift();
+    config.value = configData[1];
+    if (selectConfig.length > 1) selectConfig.shift();
   }
   getList();
 };
+
+const warehouseList = ref([]);
+const warehouseListData = () => {
+  // // 币种数据
+  proxy
+    .post("/warehouse/page", {
+      pageNum: 1,
+      pageSize: 999,
+    })
+    .then((message) => {
+      warehouseList.value = message.rows;
+      selectConfig[0].data = warehouseList.value.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+warehouseListData();
 </script>
   
 <style lang="scss" scoped>

+ 28 - 0
src/views/customer/portrait/com/LatestProgress.vue

@@ -0,0 +1,28 @@
+<template>
+  <div v-loading="loading">
+    <el-timeline reverse>
+      <el-timeline-item
+        v-for="(item, index) in progressList"
+        :key="index"
+        color="#0084FF"
+        placement="top"
+        hide-timestamp
+      >
+        <div class="details">
+          <div class="t">{{ getTitle(item.dataType) }}</div>
+          <div class="content11">
+            <span class="gray"> 跟进摘要: </span>
+            <span class="val"> {{ getContent(item) }} </span>
+          </div>
+          <div class="gray">{{ item.sortTime }}</div>
+        </div>
+      </el-timeline-item>
+    </el-timeline>
+  </div>
+</template>
+
+<script setup>
+const getTitle = () => {};
+const getContent = () => {};
+</script>
+

+ 102 - 0
src/views/customer/portrait/com/SalesDetails.vue

@@ -0,0 +1,102 @@
+<template>
+  <div class="content">
+    <div>
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="[]"
+        :table-events="{}"
+        :action-list="[]"
+        @get-list="getList"
+        :hideSearch="true"
+      >
+        <template #address="{ item }">
+          <div>
+            {{ item.countryName }}, {{ item.provinceName }} ,
+            {{ item.cityName }}, {{ item.areaDetail }}
+          </div>
+        </template>
+      </byTable>
+    </div>
+  </div>
+</template>
+  
+<script setup>
+import byTable from "@/components/byTable/index";
+const loading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "时间",
+        prop: "type",
+      },
+    },
+    {
+      attrs: {
+        label: "样品单",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "业务员",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "预付款",
+        prop: "remarks",
+        slot: "address",
+      },
+    },
+    {
+      attrs: {
+        label: "客户",
+        prop: "contactPerson",
+      },
+    },
+  ];
+});
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/supplierInfo/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);
+    });
+};
+
+getList();
+</script>
+  
+<style lang="scss" scoped>
+.content {
+  padding: 10px;
+}
+</style>

+ 116 - 0
src/views/customer/portrait/index.vue

@@ -0,0 +1,116 @@
+<template>
+  <div class="box">
+    <div class="left">
+      <div class="top bck">
+        <div class="scroll">
+          <div class="title-box">
+            <TitleInfo :content="titleList[0]"></TitleInfo>
+          </div>
+          <div class="content-box">0</div>
+        </div>
+      </div>
+
+      <div class="bottom bck">
+        <div class="scroll">
+          <div class="title-box">
+            <TitleInfo :content="titleList[1]"></TitleInfo>
+          </div>
+          <div class="content-box">1</div>
+        </div>
+      </div>
+    </div>
+    <div class="right">
+      <div class="box-one bck">
+        <div class="scroll">
+          <div class="title-box">
+            <TitleInfo :content="titleList[2]"></TitleInfo>
+          </div>
+          <div class="content-box">2</div>
+        </div>
+      </div>
+
+      <div class="box-two bck">
+        <div class="scroll">
+          <div class="title-box">
+            <TitleInfo :content="titleList[3]"></TitleInfo>
+          </div>
+          <div class="content-box">3</div>
+        </div>
+      </div>
+
+      <div class="box-three bck">
+        <div class="scroll">
+          <div class="title-box">
+            <TitleInfo :content="titleList[4]"></TitleInfo>
+          </div>
+          <div class="content-box">
+            <SalesDetails></SalesDetails>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import TitleInfo from "@/components/TitleInfo/index.vue";
+import SalesDetails from "./com/SalesDetails.vue";
+const titleList = ["客户信息", "最新跟进", "销售统计", "销售走势", "销售明细"];
+</script>
+
+<style lang="scss" scoped>
+.box {
+  display: flex;
+  padding: 10px;
+  height: calc(100vh - 120px);
+  // overflow-y: auto;
+
+  .left {
+    width: 400px;
+    margin-right: 10px;
+    display: flex;
+    flex-direction: column;
+    height: calc(100vh - 120px);
+    .top {
+      margin-bottom: 10px;
+      min-height: 100px;
+    }
+    .bottom {
+      flex: 1;
+    }
+  }
+  .right {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    height: calc(100vh - 120px);
+    .box-one,
+    .box-three {
+      // flex: 1;
+      height: 200px;
+    }
+    .box-two {
+      flex: 1;
+      margin: 10px 0;
+    }
+  }
+}
+.bck {
+  background-color: #fff;
+}
+.scroll {
+  display: flex;
+  flex-direction: column;
+  padding: 10px;
+  height: 100%;
+  box-sizing: border-box;
+  .title-box {
+    height: 24px;
+  }
+  .content-box {
+    flex: 1;
+    padding-top: 10px;
+    overflow-y: auto;
+  }
+}
+</style>

+ 9 - 14
src/views/purchaseManage/supplier/supplier/index.vue

@@ -34,6 +34,7 @@
       v-model="dialogVisible"
       width="800"
       v-loading="loading"
+      destroy-on-close
     >
       <byForm
         :formConfig="formConfig"
@@ -43,7 +44,7 @@
         ref="byform"
       >
         <template #address>
-          <el-row :gutter="10" style="width: 100%; margin-left: -15px">
+          <el-row :gutter="10" style="width: 100%">
             <el-col :span="8">
               <el-form-item prop="countryId">
                 <el-select
@@ -89,7 +90,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-          <el-row style="margin-top: 20px; width: 100%; margin-left: -10px">
+          <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="24">
               <el-form-item prop="areaDetail">
                 <el-input v-model="formData.data.areaDetail" type="textarea">
@@ -100,7 +101,7 @@
         </template>
 
         <template #contact>
-          <el-row :gutter="10" style="width: 100%; margin-left: -15px">
+          <el-row :gutter="10" style="width: 100%">
             <el-col :span="8">
               <el-form-item prop="contactPerson">
                 <el-input
@@ -227,16 +228,7 @@ const selectConfig = reactive([
   {
     label: "供应商类型",
     prop: "type",
-    data: [
-      {
-        label: "贸易商",
-        value: "1",
-      },
-      {
-        label: "工厂",
-        value: "2",
-      },
-    ],
+    data: [],
   },
 ]);
 const config = computed(() => {
@@ -535,7 +527,10 @@ const supplierType = ref([]);
 const getDict = () => {
   proxy.getDict(["supplier_type"]).then((res) => {
     supplierType.value = res["supplier_type"];
-    console.log(res, "qsss");
+    selectConfig[0].data = supplierType.value.map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
   });
 };
 getDict();

+ 37 - 34
src/views/purchaseSales/outAndInWarehouse/warehouseAdjustment/index.vue

@@ -39,7 +39,7 @@
               >添加明细</el-button
             >
             <el-table
-              :data="formData.data.list"
+              :data="formData.data.stockTransferDetailsList"
               style="width: 100%; margin-top: 16px"
             >
               <el-table-column
@@ -62,12 +62,14 @@
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
                     <el-form-item
-                      :prop="'list.' + $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"
                         placeholder="请输入数量"
                         style="width: 100%"
                         :precision="0"
@@ -132,8 +134,8 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
-    warehouseId: "",
-    toWarehouseId: "",
+    outWarehouseId: "",
+    inWarehouseId: "",
     type: "3,11",
   },
 });
@@ -142,12 +144,12 @@ const selectConfig = computed(() => {
   return [
     {
       label: "调出仓库",
-      prop: "warehouseId",
+      prop: "outWarehouseId",
       data: warehouseList.value,
     },
     {
       label: "调入仓库",
-      prop: "toWarehouseId",
+      prop: "inWarehouseId",
       data: warehouseList.value,
     },
   ];
@@ -164,7 +166,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "调出仓库",
-        prop: "warehouseName",
+        prop: "outWarehouseName",
         width: 220,
       },
       // render(type) {
@@ -174,7 +176,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "调入仓库",
-        prop: "toWarehouseName",
+        prop: "inWarehouseName",
         width: 220,
       },
       // render(type) {
@@ -212,7 +214,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "调仓数量",
-        prop: "quantity",
+        prop: "outQuantity",
         width: 140,
       },
     },
@@ -248,7 +250,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/stockJournalDetails/page", sourceList.value.pagination)
+    .post("stockTransferDetails/page", sourceList.value.pagination)
     .then((res) => {
       sourceList.value.data = res.rows;
       sourceList.value.pagination.total = res.total;
@@ -279,7 +281,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "warehouseId",
+      prop: "outWarehouseId",
       label: "调出仓库",
       required: true,
       data: warehouseList.value,
@@ -287,7 +289,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "toWarehouseId",
+      prop: "inWarehouseId",
       label: "调入仓库",
       required: true,
       data: warehouseList.value,
@@ -307,36 +309,37 @@ const formConfig = computed(() => {
   ];
 });
 const rules = ref({
-  warehouseId: [
+  outWarehouseId: [
     { required: true, message: "请选择调出仓库", trigger: "change" },
   ],
-  toWarehouseId: [
+  inWarehouseId: [
     { required: true, message: "请选择调入仓库", trigger: "change" },
   ],
-  quantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
+  outQuantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
 });
 const openModal = () => {
   formData.data = {
     type: "1",
-    list: [],
+    stockTransferDetailsList: [],
   };
   loadingDialog.value = false;
   dialogVisible.value = true;
 };
 const pushGoods = (goods) => {
   if (goods && goods.length > 0) {
-    formData.data.list = formData.data.list.concat(
-      goods.map((item) => {
-        return {
-          productCode: item.code,
-          productId: item.id,
-          productName: item.name,
-          productSpec: item.spec,
-          productUnit: item.unit,
-          quantity: undefined,
-        };
-      })
-    );
+    formData.data.stockTransferDetailsList =
+      formData.data.stockTransferDetailsList.concat(
+        goods.map((item) => {
+          return {
+            productCode: item.code,
+            productId: item.id,
+            productName: item.name,
+            productSpec: item.spec,
+            productUnit: item.unit,
+            outQuantity: undefined,
+          };
+        })
+      );
     ElMessage({
       message: "添加成功!",
       type: "success",
@@ -348,19 +351,19 @@ const pushGoods = (goods) => {
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    if (formData.data.warehouseId === formData.data.toWarehouseId)
+    if (formData.data.outWarehouseId === formData.data.inWarehouseId)
       return ElMessage({
         message: "调出仓库和调入仓库不可一致!",
         type: "info",
       });
 
-    if (!formData.data.list.length > 0)
+    if (!formData.data.stockTransferDetailsList.length > 0)
       return ElMessage({
         message: "请添加调仓明细",
         type: "info",
       });
     loadingDialog.value = true;
-    proxy.post("/stock/stockTransfer", formData.data).then(
+    proxy.post("/stockTransfer/addSt", formData.data).then(
       () => {
         ElMessage({
           message: "提交成功",
@@ -377,7 +380,7 @@ const submitForm = () => {
   });
 };
 const handleDelete = (index) => {
-  formData.data.list.splice(index, 1);
+  formData.data.stockTransferDetailsList.splice(index, 1);
 };
 </script>
 

+ 66 - 34
src/views/purchaseSales/stockManage/inventory/index.vue

@@ -36,6 +36,7 @@
       v-model="dialogVisible"
       width="800"
       v-loading="loading"
+      destroy-on-close
     >
       <byForm
         :formConfig="formConfig"
@@ -51,6 +52,7 @@
               @click="openProduct = true"
               style="margin-bottom: 10px"
               v-if="modalType == 'add'"
+              :disabled="!formData.data.warehouseId"
             >
               添加物品
             </el-button>
@@ -58,7 +60,6 @@
               <el-table-column prop="productCode" label="物品编码" />
               <el-table-column prop="productName" label="物品名称" />
               <el-table-column prop="productUnit" label="单位" />
-
               <el-table-column prop="quantity" label="库存数量" />
               <el-table-column
                 prop="checkQuantity"
@@ -282,7 +283,7 @@ const formConfig = reactive([
   {
     type: "select",
     prop: "warehouseId",
-    label: "盘点仓库",
+    label: "仓库名称",
     itemWidth: 33,
     isLoad: {
       url: "/warehouse/page",
@@ -397,9 +398,28 @@ const pushGoods = (goods) => {
     productCode: x.code,
     productUnit: x.unit,
   }));
-  formData.data.list = formData.data.list.concat(arr);
+  const ids = arr.map((x) => x.productId);
+  if (formData.data.warehouseId) {
+    proxy
+      .post("/stock/pageByWarehouse", {
+        id: formData.data.warehouseId,
+        productIds: ids,
+      })
+      .then((res) => {
+        const productList = res.rows;
+        for (let i = 0; i < productList.length; i++) {
+          const e = productList[i];
+          for (let j = 0; j < arr.length; j++) {
+            const jele = arr[j];
+            if (e.productId === jele.productId) {
+              formData.data.list.push({ ...jele, quantity: e.quantity });
+            }
+          }
+        }
+      });
+  }
   return ElMessage({
-    message: "添加成功!",
+    message: "添加成功,已为你自动过滤库存数量为0的数据 !",
     type: "success",
   });
 };
@@ -412,34 +432,33 @@ const handleRemove = (index) => {
   });
 };
 
-watchEffect(() => {
-  const list = formData.data.list;
-  if (
-    formData.data.warehouseId &&
-    list.length > 0 &&
-    modalType.value == "add"
-  ) {
-    proxy
-      .post("/stock/pageByWarehouse", {
-        id: formData.data.warehouseId,
-        productIds: list.map((x) => x.productId),
-      })
-      .then((res) => {
-        const productList = res.rows;
-        for (let i = 0; i < list.length; i++) {
-          const e = list[i];
-          e.quantity = 0;
-          for (let j = 0; j < productList.length; j++) {
-            const x = productList[j];
-            if (e.productId == x.productId) {
-              e.quantity = x.quantity;
-            }
-          }
-        }
-        handleChange();
-      });
-  }
-});
+// watchEffect(() => {
+//   const list = formData.data.list;
+//   if (
+//     formData.data.warehouseId &&
+//     list.length > 0 &&
+//     modalType.value == "add"
+//   ) {
+//     proxy
+//       .post("/stock/pageByWarehouse", {
+//         id: formData.data.warehouseId,
+//         productIds: list.map((x) => x.productId),
+//       })
+//       .then((res) => {
+//         const productList = res.rows;
+//         for (let i = 0; i < list.length; i++) {
+//           const e = list[i];
+//           e.quantity = 0;
+//           for (let j = 0; j < productList.length; j++) {
+//             if (e.productId == x.productId) {
+//               e.quantity = x.quantity;
+//             }
+//           }
+//         }
+//         handleChange();
+//       });
+//   }
+// });
 
 const handleChange = (index) => {
   if (!formData.data.list[index].quantity) return;
@@ -473,6 +492,17 @@ const handleClickCode = (row) => {
   modalType.value = "edit";
   proxy.post("/stockCheck/detail", { id: row.id }).then((res) => {
     formConfig[0].disabled = true;
+    res.list.forEach((x) => {
+      if (Number(x.checkQuantity) > Number(x.quantity)) {
+        x.result = "盘盈";
+      }
+      if (Number(x.checkQuantity) < Number(x.quantity)) {
+        x.result = "盘亏";
+      }
+      if (Number(x.checkQuantity) == Number(x.quantity)) {
+        x.result = "正常";
+      }
+    });
     formData.data = {
       warehouseId: row.warehouseId,
       list: res.list,
@@ -486,10 +516,12 @@ const handleClickCode = (row) => {
 .tenant {
   padding: 20px;
 }
+</style>
+<style >
 .redClass {
-  color: red !important;
+  color: #f54a45 !important;
 }
 .greenClass {
-  color: green !important;
+  color: #39c55a !important;
 }
 </style>

+ 3 - 3
src/views/salesMange/saleContract/claim/index.vue

@@ -149,15 +149,15 @@ const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
     label: "认领状态",
-    prop: "type",
+    prop: "isClaim",
     data: [
       {
         label: "未认领",
-        value: "1",
+        value: "0",
       },
       {
         label: "已认领",
-        value: "2",
+        value: "1",
       },
     ],
   },