Parcourir la source

采购 订单

cz il y a 2 ans
Parent
commit
112bf86688

+ 50 - 0
src/api/inbound-outbound/inbound/index.js

@@ -0,0 +1,50 @@
+import request from '@/router/axios'
+
+// inbound列表 
+export function inboundList(data = {}) {
+  return request({
+    url: '/api/victoriatourist/applyIn/page',
+    method: 'post',
+    data: data,
+  })
+}
+
+
+
+// 未入库下拉列表 
+export function saleOrdersList(data = {}) {
+  return request({
+    url: '/api/victoriatourist/logisticsInfo/list',
+    method: 'post',
+    data: data,
+  })
+}
+// 根据未入库订单查询采购入库列表 
+export function inboundDetails(data = {}) {
+  return request({
+    url: '/api/victoriatourist/purchase/in/stock/getLogisticsDetailsByLogisticsId',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 采购入库 
+export function purchaseAdd(data = {}) {
+  return request({
+    url: '/api/victoriatourist/purchase/in/stock/add',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 手动入库 
+export function manualAdd(data = {}) {
+  return request({
+    url: '/api/victoriatourist/manual/in/stock/add',
+    method: 'post',
+    data: data,
+  })
+}
+
+
+

+ 48 - 0
src/api/inbound-outbound/outbound/index.js

@@ -0,0 +1,48 @@
+import request from '@/router/axios'
+
+// customer列表 
+export function customerList(data = {}) {
+  return request({
+    url: '/api/victoriatourist/customerInfo/page',
+    method: 'post',
+    data: data,
+  })
+}
+
+
+
+// 添加customer 
+export function customerAdd(data = {}) {
+  return request({
+    url: '/api/victoriatourist/customerInfo/add',
+    method: 'post',
+    data: data,
+  })
+}
+// customer详情 
+export function customerDetails(data = {}) {
+  return request({
+    url: '/api/victoriatourist/customerInfo/details',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 编辑customer 
+export function customerEdit(data = {}) {
+  return request({
+    url: '/api/victoriatourist/customerInfo/edit',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 删除customer 
+export function customerDel(data = {}) {
+  return request({
+    url: '/api/victoriatourist/customerInfo/delete',
+    method: 'post',
+    data: data,
+  })
+}
+

+ 15 - 15
src/api/order-management/order/index.js

@@ -1,9 +1,9 @@
 import request from '@/router/axios'
 
-// customer列表 
-export function customerList(data = {}) {
+// 订单列表 
+export function orderList(data = {}) {
   return request({
-    url: '/api/victoriatourist/customerInfo/page',
+    url: '/api/victoriatourist/orderSales/page',
     method: 'post',
     data: data,
   })
@@ -11,36 +11,36 @@ export function customerList(data = {}) {
 
 
 
-// 添加customer 
-export function customerAdd(data = {}) {
+// 添加order 
+export function orderAdd(data = {}) {
   return request({
-    url: '/api/victoriatourist/customerInfo/add',
+    url: '/api/victoriatourist/orderSales/add',
     method: 'post',
     data: data,
   })
 }
-// customer详情 
-export function customerDetails(data = {}) {
+// order详情 
+export function orderDetails(data = {}) {
   return request({
-    url: '/api/victoriatourist/customerInfo/details',
+    url: '/api/victoriatourist/orderSalesDetails/listByOrderSalesId',
     method: 'post',
     data: data,
   })
 }
 
-// 编辑customer 
-export function customerEdit(data = {}) {
+// 编辑order 
+export function orderEdit(data = {}) {
   return request({
-    url: '/api/victoriatourist/customerInfo/edit',
+    url: '/api/victoriatourist/orderSales/edit',
     method: 'post',
     data: data,
   })
 }
 
-// 删除customer 
-export function customerDel(data = {}) {
+// 删除order 
+export function orderDel(data = {}) {
   return request({
-    url: '/api/victoriatourist/customerInfo/delete',
+    url: '/api/victoriatourist/orderSales/delete',
     method: 'post',
     data: data,
   })

+ 41 - 0
src/api/purchase-management/deliver-goods/index.js

@@ -0,0 +1,41 @@
+import request from '@/router/axios'
+
+// 发货管理列表 
+export function deliveryList(data = {}) {
+  return request({
+    url: '/api/victoriatourist/purchase/page',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 发货
+export function deliveryAdd(data = {}) {
+  return request({
+    url: '/api/victoriatourist/logisticsInfo/add',
+    method: 'post',
+    data: data,
+  })
+}
+
+
+// 完成采购
+export function completePurchase(data = {}) {
+  return request({
+    url: '/api/victoriatourist/purchase/complete',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 查看
+export function purchaseDetails(data = {}) {
+  return request({
+    url: '/api/victoriatourist/purchase/flow/details',
+    method: 'post',
+    data: data,
+  })
+}
+
+
+

+ 207 - 0
src/components/select-good/index.vue

@@ -0,0 +1,207 @@
+<template>
+  <div>
+    <el-row :gutter="10">
+      <el-col :span="6">
+        <tree :treeData="treeData" @treeClick="reload" ref="tree"></tree>
+      </el-col>
+      <el-col :span="18" class="right">
+        <el-card class="top">
+          <el-form :model="form">
+            <el-form-item
+              :label="$t('purchase_management.subscribe.goodClassify')"
+            >
+              <el-radio-group v-model="form.type" @change="handleTypeChange">
+                <el-radio-button label="1"> 产品</el-radio-button>
+                <el-radio-button label="2"> 物料</el-radio-button>
+              </el-radio-group>
+            </el-form-item>
+          </el-form>
+        </el-card>
+        <el-card class="bottom">
+          <el-table :data="tableList" v-loading="loading">
+            <el-table-column
+              v-if="form.type === '1'"
+              :label="$t('purchase_management.subscribe.goodType')"
+              align="center"
+              prop="type"
+              :formatter="(row) => dictDataEcho(row.type, productTypeList)"
+            />
+            <el-table-column
+              v-if="form.type === '2'"
+              :label="$t('purchase_management.subscribe.goodType')"
+              align="center"
+              prop="type"
+              :formatter="(row) => dictDataEcho(row.type, materialTypeList)"
+            />
+            <el-table-column
+              :label="$t('purchase_management.subscribe.goodCode')"
+              align="center"
+              prop="code"
+            />
+            <el-table-column
+              :label="$t('purchase_management.subscribe.goodName')"
+              align="center"
+              prop="name"
+            />
+            <el-table-column
+              :label="$t('purchase_management.subscribe.goodUnit')"
+              align="center"
+              prop="unit"
+            />
+
+            <el-table-column :label="$t('operation')" align="center" width="80">
+              <template slot-scope="scope">
+                <el-button type="text" @click="handleSelect(scope.row)"
+                  >{{ $t("select") }}
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+
+          <pagination
+            v-show="total > 0"
+            :total="total"
+            :page.sync="req.pageNum"
+            :limit.sync="req.pageSize"
+            @pagination="getList"
+          />
+        </el-card>
+      </el-col>
+    </el-row>
+    <div></div>
+  </div>
+</template>
+
+<script>
+import {
+  productTree,
+  productList,
+} from "@/api/product-material/product/index.js";
+import {
+  materialTree,
+  materialList,
+} from "@/api/product-material/material/index.js";
+
+import tree from "./tree.vue";
+
+export default {
+  components: {
+    tree,
+  },
+  data() {
+    return {
+      treeData: [],
+      productTypeList: [],
+      materialTypeList: [],
+      req: { pageNum: 1, pageSize: 10, classifyId: "" },
+      form: {
+        name: "",
+        type: "1",
+      },
+      loading: false,
+      tableList: [],
+      total: 0,
+    };
+  },
+  created() {
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.productTypeList = businessDictData.find(
+      (item) => item.code === "productType"
+    ).children;
+    this.materialTypeList = businessDictData.find(
+      (item) => item.code === "materialType"
+    ).children;
+    this.getTree();
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+
+      if (this.form.type === "1") {
+        productList(this.req).then(
+          (res) => {
+            this.tableList = res.data.data.records;
+            this.total = res.data.data.total;
+            this.loading = false;
+          },
+          (err) => {
+            console.log("productList: " + err);
+            this.loading = false;
+          }
+        );
+      } else {
+        materialList(this.req).then(
+          (res) => {
+            this.tableList = res.data.data.records;
+            this.total = res.data.data.total;
+            this.loading = false;
+          },
+          (err) => {
+            console.log("materialList: " + err);
+            this.loading = false;
+          }
+        );
+      }
+    },
+    getTree() {
+      this.$nextTick(() => {
+        this.$refs.tree.loading = true;
+      });
+      if (this.form.type === "1") {
+        productTree(this.form).then(
+          (res) => {
+            this.treeData = res.data.data;
+            this.$refs.tree.loading = false;
+          },
+          (err) => {
+            console.log("productTree: " + err);
+          }
+        );
+      } else {
+        materialTree(this.form).then(
+          (res) => {
+            this.treeData = res.data.data;
+            this.$refs.tree.loading = false;
+          },
+          (err) => {
+            console.log("materialTree: " + err);
+          }
+        );
+      }
+    },
+    handleTypeChange() {
+      this.req.pageNum = 1;
+      this.req.classifyId = "";
+      this.getTree();
+      this.getList();
+    },
+    reload(row) {
+      this.req.pageNum = 1;
+      this.req.classifyId = row.id;
+      this.getList();
+    },
+    handleSelect(row) {
+      this.$emit("select", row);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.right {
+  height: calc(100% - 110px);
+  overflow-y: auto;
+  display: flex;
+  flex-direction: column;
+  .top {
+    // padding: 10px;
+    margin-bottom: 8px;
+  }
+  .bottom {
+    flex: 1;
+  }
+}
+</style>

+ 234 - 0
src/components/select-good/tree.vue

@@ -0,0 +1,234 @@
+<template>
+  <el-card
+    shadow="always"
+    :body-style="{ padding: '20px' }"
+    v-loading="loading"
+  >
+    <div class="tree-title">
+      <div class="bk"></div>
+      <div>{{ $t("purchase_management.subscribe.goodClassify") }}</div>
+    </div>
+    <el-row class="search" style="display: flex; align-items: center">
+      <el-input :placeholder="$t('search')" v-model="filterText" size="small">
+      </el-input>
+    </el-row>
+    <el-tree
+      ref="tree"
+      :data="treeData"
+      :props="defaultProps"
+      default-expand-all
+      @node-click="handleNodeClick"
+      :filter-node-method="filterNode"
+    >
+      <span class="custom-tree-node" slot-scope="{ node, data }">
+        <span>{{ node.label }}</span>
+      </span>
+    </el-tree>
+  </el-card>
+</template>
+
+<script>
+import * as API from "@/api/product-material/product/index.js";
+// import test from "@/components/form-test/index.vue";
+export default {
+  name: "tree",
+  props: {
+    treeData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      loading: true,
+      filterText: "",
+      treeQuery: {
+        type: "1",
+        name: "",
+      },
+      // treeData: [],
+      treeParams: {
+        id: null,
+        type: null,
+        parentId: null,
+        parentIdSet: null,
+        name: null,
+      },
+      currentNode: {},
+      treeForm: {
+        loadingStatus: false,
+        name: {
+          label: this.$t("product_material.product.treeName"),
+          type: "input",
+        },
+        otherButton: {
+          align: "center",
+          list: [
+            {
+              name: this.$t("cancelText"),
+              methodsText: "cancel",
+              cancel: () => {
+                this.treeModal = false;
+              },
+            },
+            {
+              name: this.$t("submitText"),
+              methodsText: "submit",
+              type: "primary",
+              submit: () => {
+                this.treehandleSubmit();
+              },
+            },
+          ],
+        },
+      },
+      treeRules: {
+        name: [
+          {
+            required: true,
+            message: this.$t("product_material.product.nameRules"),
+            trigger: "blur",
+          },
+        ],
+      },
+      treeModalType: "add",
+      treeModal: false,
+      defaultProps: {
+        children: "children",
+        label: "name",
+      },
+    };
+  },
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+  created() {
+    // this.getTree();
+  },
+  methods: {
+    handleMouseenter(data) {
+      this.currentNode = data;
+    },
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.name.indexOf(value) !== -1;
+    },
+    resetForm(formName) {},
+    treehandleSubmit() {
+      this.$refs.form.$refs["form"].validate((valid) => {
+        if (valid) {
+          this.treeForm.loadingStatus = true;
+          if (!this.treeParams.id) {
+            API.productClassifyAdd(this.treeParams).then(
+              () => {
+                this.msgSuccess(this.$t("addSuccess"));
+                this.treeModal = false;
+                this.treeForm.loadingStatus = false;
+                this.getTree();
+              },
+              (err) => {
+                console.log("productClassifyAdd: " + err);
+                this.treeForm.loadingStatus = false;
+              }
+            );
+          } else {
+            API.productClassifyEdit(this.treeParams).then(
+              () => {
+                this.msgSuccess(this.$t("editSuccess"));
+                this.treeModal = false;
+                this.treeForm.loadingStatus = false;
+                this.getTree();
+              },
+              (err) => {
+                console.log("productClassifyEdit: " + err);
+                this.treeForm.loadingStatus = false;
+              }
+            );
+          }
+        }
+      });
+    },
+    handleNodeClick(row) {
+      this.$emit("treeClick", row);
+    },
+    getTree() {
+      this.loading = true;
+      API.productTree(this.treeQuery).then(
+        (res) => {
+          this.treeData = res.data.data;
+          this.loading = false;
+        },
+        (err) => {
+          console.log("productTree: " + err);
+          this.loading = false;
+        }
+      );
+    },
+    add(row) {
+      this.treeParams = {
+        parentIdSet: "",
+        type: "1",
+        parentId: "",
+        name: "",
+      };
+      this.treeParams.parentId = row.id;
+      this.treeModal = true;
+    },
+    edit(node, row) {
+      this.treeModalType = "edit";
+      this.treeParams = {
+        type: "1",
+        parentId: node.parent.data.id,
+        name: row.name,
+        id: row.id,
+      };
+      this.treeModal = true;
+    },
+    del(row) {
+      this.$confirm(this.$t("askDeleteData"), {
+        confirmButtonText: this.$t("submitText"),
+        cancelButtonText: this.$t("cancelText"),
+        type: "warning",
+      })
+        .then(() => {
+          API.productClassifyDel({ id: row.id, type: "1" }).then(() => {
+            this.msgSuccess(this.$t("deleteSuccess"));
+            this.getTree();
+          });
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+.tree-title {
+  display: flex;
+  font-size: 14px;
+  margin-bottom: 15px;
+  height: 20px;
+  line-height: 20px;
+  .bk {
+    width: 4px;
+    height: 100%;
+    background: rgba(0, 132, 255, 1);
+    margin-right: 8px;
+  }
+}
+.search {
+  margin-bottom: 10px;
+}
+</style>

+ 5 - 0
src/lang/zh.js

@@ -385,10 +385,15 @@ export default {
       subscribeEdit: "申购编辑",
       subscribeStatus: "申购状态",
       subscribeOddNumbers: '申购单号',
+      goodClassify: "物品分类",
+
       goodCode: "物品编码",
       goodName: "物品名称",
       goodType: "物品类型",
+      goodUnit: "物品单位",
+
       unit: "单位",
+
       subscribeNums: "申购数量",
       askArrivalTime: "要求到货时间",
       harvestWarehouse: "收货仓库",

+ 26 - 0
src/router/page/index.js

@@ -281,6 +281,19 @@ export default [
     ],
   },
   {
+    path: '/purchase-management/deliver-goods',
+    component: Layout,
+    redirect: '/purchase-management/deliver-goods/index',
+    children: [
+      {
+        path: 'index',
+        name: '发货管理',
+        component: () => import(/* webpackChunkName: "page" */ '@/views/purchase-management/deliver-goods/index'),
+        props: true,
+      },
+    ],
+  },
+  {
     path: '/order-management/order',
     component: Layout,
     redirect: '/order-management/order/index',
@@ -294,6 +307,19 @@ export default [
     ],
   },
   {
+    path: '/inbound-outbound/inbound',
+    component: Layout,
+    redirect: '/inbound-outbound/inbound/index',
+    children: [
+      {
+        path: 'index',
+        name: '入库管理',
+        component: () => import(/* webpackChunkName: "page" */ '@/views/inbound-outbound/inbound/index'),
+        props: true,
+      },
+    ],
+  },
+  {
     path: '/inbound-outbound/outbound',
     component: Layout,
     redirect: '/inbound-outbound/outbound/index',

+ 336 - 0
src/views/inbound-outbound/inbound/addInbound.vue

@@ -0,0 +1,336 @@
+<template>
+  <div v-loading="loading">
+    <div class="form-box">
+      <el-form
+        label-position="top"
+        :model="form"
+        ref="form"
+        :rules="inboundType === 10 ? formRules : formRules1"
+        label-width="100px"
+      >
+        <el-form-item label-width="0px" v-if="inboundType === 20">
+          <el-button type="primary" @click="handleAddProduct">
+            添加物品</el-button
+          >
+        </el-form-item>
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="物流单号" prop="id" v-if="inboundType === 10">
+              <el-select
+                v-model="form.id"
+                :placeholder="$t('pleaseSelect')"
+                style="width: 100%"
+                @change="handleChange"
+              >
+                <el-option
+                  v-for="item in selectList"
+                  :key="item.id"
+                  :label="item.code"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="收获仓库" prop="id" v-if="inboundType === 20">
+              <el-select
+                v-model="form.id"
+                :placeholder="$t('pleaseSelect')"
+                style="width: 100%"
+                @change="handleChangeWarehouse"
+              >
+                <el-option
+                  v-for="item in warehouseSelectList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                  <span style="float: left">{{
+                    `${item.name}(${dictDataEcho(
+                      item.type,
+                      warehouseTypeList
+                    )})`
+                  }}</span>
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-form-item v-if="inboundType === 10">
+          <el-table :data="form.changeDetailsList">
+            <el-table-column label="申购单号" prop="applyPurchaseCode">
+            </el-table-column>
+            <el-table-column label="物品编码" prop="productCode">
+            </el-table-column>
+            <el-table-column label="物品名称" prop="productName">
+            </el-table-column>
+            <el-table-column label="物品类型" prop="productType">
+            </el-table-column>
+            <el-table-column label="收货仓库" prop="warehouseName">
+            </el-table-column>
+            <el-table-column label="申购数量" prop="applyPurchaseQuantity">
+            </el-table-column>
+            <el-table-column label="发货数量" prop="shipmentQuantity">
+            </el-table-column>
+            <el-table-column label="到货数量" prop="changeQuantity">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="
+                    'changeDetailsList.' + scope.$index + '.changeQuantity'
+                  "
+                  :rules="formRules.changeQuantity"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input
+                    v-model="scope.row.changeQuantity"
+                    :placeholder="$t('pleaseInput')"
+                    size="mini"
+                  >
+                  </el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+        <el-form-item v-if="inboundType === 20">
+          <el-table :data="form.changeDetailsList">
+            <el-table-column label="物品编码" prop="productCode">
+            </el-table-column>
+            <el-table-column label="物品名称" prop="productName">
+            </el-table-column>
+            <el-table-column label="物品类型" prop="productType">
+            </el-table-column>
+            <el-table-column label="收货仓库" prop="warehouseName">
+            </el-table-column>
+            <el-table-column label="仓库现有库存" prop="applyPurchaseQuantity">
+            </el-table-column>
+
+            <el-table-column label="入库数量" prop="changeQuantity">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="
+                    'changeDetailsList.' + scope.$index + '.changeQuantity'
+                  "
+                  :rules="formRules1.changeQuantity"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input
+                    v-model="scope.row.changeQuantity"
+                    :placeholder="$t('pleaseInput')"
+                    size="mini"
+                  >
+                  </el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column
+              :label="$t('operation')"
+              width="100"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <el-button type="text" @click="deleteRow(scope.$index)">{{
+                  $t("delete")
+                }}</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div style="text-align: center; margin-top: 15px">
+      <el-button size="small" @click="handleCancel"
+        >{{ $t("cancel") }}
+      </el-button>
+      <el-button type="primary" size="small" @click="handleSubmit">
+        {{ $t("submit") }}</el-button
+      >
+    </div>
+
+    <el-dialog
+      :title="$t('goodsSelect')"
+      v-if="selectDialog"
+      :visible.sync="selectDialog"
+      width="80%"
+      top="60px"
+    >
+      <selectProduct @select="handleSelect"></selectProduct>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import labelTitle from "@/components/label-title/index.vue";
+import selectProduct from "@/components/select-product/index.vue";
+
+import * as API from "@/api/inbound-outbound/inbound/index.js";
+
+export default {
+  name: "addInbound",
+  components: { labelTitle, selectProduct },
+  props: {
+    // 入库类型  10 采购入库  20 手动入库
+    inboundType: {
+      type: Number,
+      default: () => 10,
+    },
+    form: {
+      type: Object,
+      default: () => {},
+    },
+    warehouseSelectList: {
+      type: Array,
+      default: () => [],
+    },
+    warehouseTypeList: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      selectLit: [],
+      loading: false,
+      formRules: {
+        id: [
+          {
+            required: true,
+            message: "请选择物流单号",
+            trigger: "change",
+          },
+        ],
+        changeQuantity: [
+          {
+            required: true,
+            message: "请输入到货数量",
+            trigger: "blur",
+          },
+        ],
+      },
+      formRules1: {
+        id: [
+          {
+            required: true,
+            message: "请选择收货仓库",
+            trigger: "change",
+          },
+        ],
+        changeQuantity: [
+          {
+            required: true,
+            message: "请输入入库数量",
+            trigger: "blur",
+          },
+        ],
+      },
+      selectDialog: false,
+      warehouseName: "",
+    };
+  },
+  created() {
+    this.getSelectList();
+  },
+  methods: {
+    getSelectList() {
+      this.loading = true;
+      API.saleOrdersList().then(
+        (res) => {
+          this.selectLit = res.data.data.records;
+          this.loading = false;
+        },
+        (err) => {
+          console.log("saleOrdersList: " + err);
+          this.loading = false;
+        }
+      );
+    },
+    handleSubmit() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.loading = true;
+          if (this.inboundType === 10) {
+            this.form.changeDetailsList = this.form.changeDetailsList.map(
+              (x) => ({
+                businessId: this.form.id,
+                goodsId: x.id,
+                warehouseId: x.warehouseId,
+                changeQuantity: x.changeQuantity,
+              })
+            );
+          } else if (this.inboundType === 20) {
+            this.form.changeDetailsList = this.form.changeDetailsList.map(
+              (x) => ({
+                goodsId: x.goodsId,
+                warehouseId: this.form.id,
+                changeQuantity: x.changeQuantity,
+              })
+            );
+          }
+          delete this.form.id;
+          this.$emit("submit");
+        }
+      });
+    },
+    handleCancel() {
+      this.$emit("cancel");
+    },
+    handleChange(id) {
+      this.loading = true;
+      API.inboundDetails({ id }).then(
+        (res) => {
+          this.form.changeDetailsList = res.data.data.map((x) => ({
+            ...x,
+            changeQuantity: "",
+          }));
+          this.loading = false;
+        },
+        (err) => {
+          console.log("inboundDetails: " + err);
+          this.loading = false;
+        }
+      );
+    },
+    handleChangeWarehouse(id) {
+      const current = this.warehouseSelectList.find((x) => x.id === id);
+      if (current) {
+        this.warehouseName = current.name;
+      }
+      this.form.changeDetailsList = [];
+    },
+    handleAddProduct() {
+      if (!this.form.id) return this.msgInfo("请先选择收获仓库");
+      this.selectDialog = true;
+    },
+    handleSelect(row) {
+      const flag = this.form.changeDetailsList.some(
+        (x) => x.goodsId === row.id
+      );
+      if (flag) return this.msgInfo("该物品已经选择");
+      const product = {
+        productCode: row.code,
+        productName: row.name,
+        productType: row.type,
+        warehouseName: this.warehouseName,
+        goodsId: row.id,
+        changeQuantity: "",
+      };
+      this.form.changeDetailsList.push(product);
+    },
+    deleteRow(index) {
+      this.form.changeDetailsList.splice(index, 1);
+      this.msgSuccess(this.$t("deleteSuccess"));
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.form-box {
+  height: calc(100vh - 280px);
+  overflow: auto;
+  box-sizing: border-box;
+  padding: 10px;
+}
+</style>

+ 323 - 0
src/views/inbound-outbound/inbound/index.vue

@@ -0,0 +1,323 @@
+
+
+<script>
+import test from "@/components/form-test/index.vue";
+import query from "@/components/query/index.vue";
+
+import byTable from "@/components/by-table/index.js";
+import addInbound from "./addInbound.vue";
+
+import * as API from "@/api/inbound-outbound/inbound/index.js";
+import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
+
+export default {
+  components: {
+    test,
+    byTable,
+    query,
+    addInbound,
+  },
+  data() {
+    return {
+      warehouseTypeList: [],
+      warehouseSelectList: [],
+      btnForm: {
+        otherButton: {
+          list: [
+            {
+              name: "采购入库",
+              methodsText: "add",
+              type: "primary",
+              add: () => {
+                this.handleAdd(10);
+              },
+            },
+            {
+              name: "手动入库",
+              methodsText: "add",
+              type: "defualt",
+              add: () => {
+                this.handleAdd(20);
+              },
+            },
+            {
+              name: "入库质检",
+              methodsText: "add",
+              type: "defualt",
+              add: () => {
+                this.handleAdd();
+              },
+            },
+          ],
+        },
+      },
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        keyword: "",
+        warehouseId: "",
+        status: "",
+        code: "",
+        goodsCode: "",
+        goodsName: "",
+        applyUserId: "",
+        startTime: "",
+        endTime: "",
+      },
+      selectConfig: [
+        {
+          label: "收获仓库",
+          prop: "type",
+          data: [],
+        },
+        {
+          label: "入库状态",
+          prop: "type",
+          data: [],
+        },
+      ],
+      tableList: [],
+      loading: false,
+      inboundType: null, // 入库类型  10 采购入库  20 手动入库
+      titleText: "",
+      open: false,
+      form: {
+        id: "",
+        changeDetailsList: [],
+      },
+    };
+  },
+  created() {
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.warehouseTypeList = businessDictData.find(
+      (item) => item.code === "warehouseType"
+    ).children;
+    this.selectConfig[0].data = this.warehouseTypeList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
+    warehouseSelectList().then((res) => {
+      this.warehouseSelectList = res.data.data;
+    });
+    // this.getList();
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+      API.outboundList(this.queryParams).then(
+        (res) => {
+          console.log(res, "qq");
+          this.tableList = res.data.data.records;
+          this.total = res.data.data.total;
+          this.loading = false;
+        },
+        (err) => {
+          console.log("outboundList: " + err);
+          this.loading = false;
+        }
+      );
+    },
+    handleQuery() {
+      this.getList();
+    },
+    handleAdd(type) {
+      this.form = {
+        id: "",
+        changeDetailsList: [],
+      };
+      if (type === 10) {
+        this.titleText = "add";
+      } else {
+        this.titleText = "manual";
+      }
+      this.inboundType = type;
+      this.open = true;
+    },
+    handleCancel() {
+      this.form = {
+        id: "",
+
+        changeDetailsList: [],
+      };
+      this.open = false;
+    },
+    handleEdit(row) {
+      this.titleText = "edit";
+      this.form = row;
+      this.open = true;
+      if (this.form.fileInfoList === "") {
+        this.form.fileInfoList = [];
+      }
+      this.$nextTick(() => {
+        this.$refs.addInbound.loading = true;
+        this.$refs.addInbound.countryChange(this.form.countryId);
+        this.$refs.addInbound.provinceChange(this.form.provinceId);
+        this.$refs.addInbound.loading = false;
+      });
+    },
+    handleSubmit() {
+      if (this.inboundType === 10) {
+        API.purchaseAdd(this.form).then(
+          () => {
+            this.msgSuccess(this.$t("addSuccess"));
+            this.$refs.addInbound.loading = false;
+            this.open = false;
+            this.getList();
+          },
+          (err) => {
+            console.log("purchaseAdd: " + err);
+            this.$refs.addInbound.loading = false;
+          }
+        );
+      } else {
+        API.manualAdd(this.form).then(
+          () => {
+            this.msgSuccess(this.$t("addSuccess"));
+            this.open = false;
+            this.$refs.addInbound.loading = false;
+            this.getList();
+          },
+          (err) => {
+            console.log("manualAdd: " + err);
+            this.$refs.addInbound.loading = false;
+          }
+        );
+      }
+    },
+
+    handleDelete(row) {
+      this.$confirm(this.$t("askDeleteData"), {
+        confirmButtonText: this.$t("submitText"),
+        cancelButtonText: this.$t("cancelText"),
+        type: "warning",
+      }).then(() => {
+        API.outboundDel({ id: row.id }).then(() => {
+          this.msgSuccess(this.$t("deleteSuccess"));
+          this.getList();
+        });
+      });
+    },
+    showAddress(row) {
+      return (
+        <div>
+          {row.countryName} , {row.provinceName} , {row.cityName}
+        </div>
+      );
+    },
+  },
+};
+</script>
+
+
+<template>
+  <div class="box-card">
+    <el-card class="header">
+      <test :form-config="btnForm"></test>
+    </el-card>
+    <el-card class="body-main">
+      <query
+        :selectConfig="selectConfig"
+        :req="queryParams"
+        :isShowMore="true"
+        @handleQuery="handleQuery"
+        @handleMore="
+          () => {
+            queryDialog = true;
+          }
+        "
+      ></query>
+      <el-table :data="tableList" v-loading="loading">
+        <el-table-column
+          :label="$t('inbound_outbound.outbound.outboundOddNumbers')"
+          align="center"
+          prop="code"
+        />
+        <el-table-column
+          :label="$t('inbound_outbound.outbound.salesOddNumbers')"
+          align="center"
+          prop="name"
+        />
+        <el-table-column
+          :label="$t('inbound_outbound.outbound.customerType')"
+          align="center"
+          :formatter="showAddress"
+        />
+        <el-table-column
+          :label="$t('inbound_outbound.outbound.customerCode')"
+          align="center"
+          prop="contacts"
+        />
+        <el-table-column
+          :label="$t('inbound_outbound.outbound.customerNmae')"
+          align="center"
+          prop="phone"
+        />
+        <el-table-column
+          :label="$t('inbound_outbound.outbound.outboundQuantity')"
+          align="center"
+          prop="phone"
+        />
+        <el-table-column
+          :label="$t('inbound_outbound.outbound.createTime')"
+          align="center"
+          prop="phone"
+        />
+
+        <el-table-column
+          :label="$t('inbound_outbound.outbound.remarks')"
+          align="center"
+          prop="phone"
+        />
+
+        <el-table-column :label="$t('operation')" align="center" width="120">
+          <template slot-scope="scope">
+            <el-button type="text" @click="handleEdit(scope.row)"
+              >{{ $t("edit") }}
+            </el-button>
+            <el-button type="text" @click="handleDelete(scope.row)"
+              >{{ $t("delete") }}
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-card>
+
+    <el-dialog
+      :title="titleText === 'manual' ? '手动入库' : '采购入库'"
+      :visible.sync="open"
+      v-if="open"
+      width="80%"
+      top="60px"
+    >
+      <add-inbound
+        :form="form"
+        :warehouseSelectList="warehouseSelectList"
+        :warehouseTypeList="warehouseTypeList"
+        :inboundType="inboundType"
+        @submit="handleSubmit"
+        @cancel="handleCancel"
+        ref="addInbound"
+      ></add-inbound>
+    </el-dialog>
+  </div>
+</template>
+
+
+<style lang="scss" scoped>
+.box-card {
+  height: calc(100vh - 110px);
+  overflow-y: auto;
+  display: flex;
+  flex-direction: column;
+  .header {
+    // height: 100px;
+    margin-bottom: 10px;
+    box-sizing: border-box;
+  }
+  .body-main {
+    flex: 1;
+  }
+}
+</style>

+ 1 - 4
src/views/inbound-outbound/outbound/addOutbound.vue

@@ -10,10 +10,7 @@
       >
         <el-row>
           <el-col :span="8">
-            <el-form-item
-              :label="$t('purchase_management.subscribe.harvestWarehouse')"
-              prop="receiptWarehouseId"
-            >
+            <el-form-item label="销售订单" prop="receiptWarehouseId">
               <el-select
                 v-model="form.receiptWarehouseId"
                 :placeholder="$t('pleaseSelect')"

+ 92 - 40
src/views/order-management/order/addOrder.vue

@@ -12,15 +12,15 @@
           <el-col :span="12">
             <el-form-item
               :label="$t('order_management.order.customerName')"
-              prop="orderInfoId"
+              prop="customerInfoId"
             >
               <el-select
-                v-model="form.orderInfoId"
+                v-model="form.customerInfoId"
                 :placeholder="$t('pleaseSelect')"
                 style="width: 100%"
               >
                 <el-option
-                  v-for="item in orderSelectList"
+                  v-for="item in customerSelectList"
                   :key="item.id"
                   :label="item.name"
                   :value="item.id"
@@ -72,26 +72,36 @@
               prop="name"
             >
             </el-table-column>
-            <el-table-column
-              :label="$t('order_management.order.specs')"
-              prop="name"
-            >
-            </el-table-column>
+
             <el-table-column
               :label="$t('order_management.order.price')"
-              prop="name"
+              prop="price"
             >
             </el-table-column>
-            <el-table-column
-              :label="$t('order_management.order.quantity')"
-              prop="name"
-            >
-            </el-table-column>
-            <el-table-column
-              :label="$t('order_management.order.Subtotal')"
-              prop="name"
-            >
+
+            <el-table-column label="数量" prop="quantity">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'orderSalesDetailsList.' + scope.$index + '.quantity'"
+                  :rules="formRules.quantity"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input-number
+                    v-model="scope.row.quantity"
+                    :label="$t('pleaseInput')"
+                    style="width: 100%"
+                    size="mini"
+                    @change="totalAmount"
+                    :controls="false"
+                    :min="1"
+                    :max="9999"
+                  >
+                  </el-input-number>
+                </el-form-item>
+              </template>
             </el-table-column>
+            <el-table-column label="小计" prop="subtotal"> </el-table-column>
             <el-table-column
               :label="$t('operation')"
               width="100"
@@ -221,19 +231,6 @@
             </el-col>
           </el-row>
         </el-form-item>
-
-        <!-- <el-row>
-          <el-col span="18">
-            <el-form-item :label="$t('remark')" prop="remark">
-              <el-input
-                v-model="form.remark"
-                :placeholder="$t('pleaseInput')"
-                type="textarea"
-                rows="4"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row> -->
       </el-form>
     </div>
     <div style="text-align: center; margin-top: 15px">
@@ -274,6 +271,14 @@ export default {
       type: Object,
       default: () => {},
     },
+    customerSelectList: {
+      type: Array,
+      default: () => [],
+    },
+    orderTypeList: {
+      type: Array,
+      default: () => [],
+    },
   },
   data() {
     return {
@@ -285,42 +290,51 @@ export default {
       provinceData: [],
       cityData: [],
       loading: false,
+      selectDialog: false,
       formRules: {
-        countryId: [
+        customerInfoId: [
+          {
+            required: true,
+            message: "请选择客户",
+            trigger: "change",
+          },
+        ],
+        type: [
           {
             required: true,
             message:
               this.$t("pleaseSelect") +
-              this.$t("order_management.order.country"),
+              this.$t("order_management.order.orderType"),
             trigger: "change",
           },
         ],
-        provinceId: [
+        countryId: [
           {
             required: true,
             message:
               this.$t("pleaseSelect") +
-              this.$t("order_management.order.province"),
+              this.$t("order_management.order.country"),
             trigger: "change",
           },
         ],
-        cityId: [
+        provinceId: [
           {
             required: true,
             message:
-              this.$t("pleaseSelect") + this.$t("order_management.order.city"),
+              this.$t("pleaseSelect") +
+              this.$t("order_management.order.province"),
             trigger: "change",
           },
         ],
-        type: [
+        cityId: [
           {
             required: true,
             message:
-              this.$t("pleaseSelect") +
-              this.$t("order_management.order.orderType"),
+              this.$t("pleaseSelect") + this.$t("order_management.order.city"),
             trigger: "change",
           },
         ],
+
         name: [
           {
             required: true,
@@ -348,6 +362,13 @@ export default {
             trigger: "blur",
           },
         ],
+        quantity: [
+          {
+            required: true,
+            message: "请输入数量",
+            trigger: "blur",
+          },
+        ],
       },
       fileList: [],
     };
@@ -361,6 +382,8 @@ export default {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
+          if (!this.form.orderSalesDetailsList.length > 0)
+            return this.msgInfo("请选择您需要的产品");
           this.loading = true;
           this.$emit("submit");
         }
@@ -379,6 +402,35 @@ export default {
         this.cityData = res.data.data;
       });
     },
+    handleSelect(row) {
+      const flag = this.form.orderSalesDetailsList.some(
+        (x) => x.productId === row.id
+      );
+      if (flag) return this.msgInfo("该产品您已选择");
+      this.form.orderSalesDetailsList.push({
+        code: row.code,
+        name: row.name,
+        subtotal: "",
+        productId: row.id,
+        quantity: undefined,
+        price: row.purchasePrice,
+        remark: "",
+      });
+      this.msgSuccess(this.$t("addSuccess"));
+    },
+    deleteRow(index) {
+      this.form.orderSalesDetailsList.splice(index, 1);
+      this.msgSuccess(this.$t("deleteSuccess"));
+      this.totalAmount();
+    },
+    totalAmount() {
+      this.form.orderSalesDetailsList.forEach((x) => {
+        x.subtotal = Number(x.quantity) * Number(x.price);
+      });
+      this.form.money = this.form.orderSalesDetailsList.reduce((sum, x) => {
+        return sum + Number(x.subtotal);
+      }, 0);
+    },
     handleSuccess(response, file, fileList) {
       this.form.fileInfoList = fileList;
     },

+ 54 - 41
src/views/order-management/order/index.vue

@@ -20,6 +20,7 @@ export default {
   data() {
     return {
       orderTypeList: [],
+      orderStatusList: [],
       customerSelectList: [],
       btnForm: {
         otherButton: {
@@ -51,16 +52,21 @@ export default {
           prop: "type",
           data: [],
         },
+        {
+          label: "订单状态",
+          prop: "status",
+          data: [],
+        },
       ],
       tableList: [],
       loading: false,
       titleText: "",
       open: false,
       form: {
-        id: "",
-        code: "",
-        name: "",
-        countryId: "",
+        money: "",
+        customerInfoId: "",
+        type: "",
+        countryId: "China",
         provinceId: "",
         cityId: "",
         detailedAddress: "",
@@ -68,7 +74,7 @@ export default {
         phone: "",
         phonePrefixType: "",
         remark: "",
-        fileInfoList: [],
+        orderSalesDetailsList: [],
       },
     };
   },
@@ -83,17 +89,23 @@ export default {
       label: item.dictValue,
       value: item.dictKey,
     }));
+    this.orderStatusList = businessDictData.find(
+      (item) => item.code === "orderStatus"
+    ).children;
+    this.selectConfig[1].data = this.orderStatusList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
     customerList({ pageNum: 1, pageSize: 999 }).then((res) => {
       this.customerSelectList = res.data.data.records;
     });
-    // this.getList();
+    this.getList();
   },
   methods: {
     getList() {
       this.loading = true;
       API.orderList(this.queryParams).then(
         (res) => {
-          console.log(res, "qq");
           this.tableList = res.data.data.records;
           this.total = res.data.data.total;
           this.loading = false;
@@ -109,10 +121,10 @@ export default {
     },
     handleAdd() {
       this.form = {
-        id: "",
-        code: "",
-        name: "",
-        countryId: "",
+        money: "",
+        customerInfoId: "",
+        type: "",
+        countryId: "China",
         provinceId: "",
         cityId: "",
         detailedAddress: "",
@@ -120,17 +132,20 @@ export default {
         phone: "",
         phonePrefixType: "",
         remark: "",
-        fileInfoList: [],
+        orderSalesDetailsList: [],
       };
       this.titleText = "add";
       this.open = true;
+      this.$nextTick(() => {
+        this.$refs.addOrder.countryChange(this.form.countryId);
+      });
     },
     handleCancel() {
       this.form = {
-        id: "",
-        code: "",
-        name: "",
-        countryId: "",
+        money: "",
+        customerInfoId: "",
+        type: "",
+        countryId: "China",
         provinceId: "",
         cityId: "",
         detailedAddress: "",
@@ -138,22 +153,20 @@ export default {
         phone: "",
         phonePrefixType: "",
         remark: "",
-        fileInfoList: [],
+        orderSalesDetailsList: [],
       };
       this.open = false;
     },
-    handleEdit(row) {
-      this.titleText = "edit";
-      this.form = row;
-      this.open = true;
-      if (this.form.fileInfoList === "") {
-        this.form.fileInfoList = [];
-      }
-      this.$nextTick(() => {
-        this.$refs.addOrder.loading = true;
-        this.$refs.addOrder.countryChange(this.form.countryId);
-        this.$refs.addOrder.provinceChange(this.form.provinceId);
-        this.$refs.addOrder.loading = false;
+    handleChangeStatus(row, status) {
+      this.$confirm("是否确认进行该操作", {
+        confirmButtonText: this.$t("submitText"),
+        cancelButtonText: this.$t("cancelText"),
+        type: "warning",
+      }).then(() => {
+        API.orderEdit({ id: row.id, status }).then(() => {
+          this.msgSuccess("操作成功");
+          this.getList();
+        });
       });
     },
     handleSubmit() {
@@ -232,46 +245,46 @@ export default {
         <el-table-column
           :label="$t('order_management.order.orderType')"
           align="center"
-          prop="code"
+           :formatter="(row) => dictDataEcho(row.type, orderTypeList)"
         />
         <el-table-column
           :label="$t('order_management.order.orderCode')"
           align="center"
-          prop="name"
+          prop="code"
         />
         <el-table-column
           :label="$t('order_management.order.customerName')"
           align="center"
-          :formatter="showAddress"
+          prop="customerName"
         />
         <el-table-column
           :label="$t('order_management.order.orderAmount')"
           align="center"
-          prop="contacts"
+          prop="amountMoney"
         />
         <el-table-column
           :label="$t('order_management.order.recipientCity')"
           align="center"
-          prop="phone"
+          :formatter="showAddress"
         />
           <el-table-column
           :label="$t('order_management.order.orderTime')"
           align="center"
-          prop="phone"
+          prop="orderTime"
         />
           <el-table-column
           :label="$t('order_management.order.orderStatus')"
           align="center"
-          prop="phone"
+         :formatter="(row) => dictDataEcho(row.status, orderStatusList)"
         />
 
         <el-table-column :label="$t('operation')" align="center" width="120">
           <template slot-scope="scope">
-            <el-button type="text" @click="handleEdit(scope.row)"
-              >{{ $t("edit") }}
+            <el-button type="text" v-if="scope.row.status===1" @click="handleChangeStatus(scope.row,'2')"
+              >完成
             </el-button>
-            <el-button type="text" @click="handleDelete(scope.row)"
-              >{{ $t("delete") }}
+            <el-button type="text" v-if="scope.row.status===1" @click="handleChangeStatus(scope.row,'3')"
+              >取消
             </el-button>
           </template>
         </el-table-column>
@@ -296,7 +309,7 @@ export default {
         :orderTypeList="orderTypeList"
         @submit="handleSubmit"
         @cancel="handleCancel"
-        ref="addMaterial"
+        ref="addOrder"
       ></add-order>
     </el-dialog>
   </div>

+ 5 - 2
src/views/product-material/product/index.vue

@@ -367,9 +367,11 @@ export default {
         jdPurchasePriceMin: "",
         jdPurchasePriceMax: "",
         combination: "",
-        null: "",
-        null: "",
+
         warehouseId: "",
+        beginTime: null,
+        endTime: null,
+        productSpuId: "",
       },
       tableList: [],
       total: 0,
@@ -470,6 +472,7 @@ export default {
         combination: "",
         beginTime: null,
         endTime: null,
+        productSpuId: "",
         warehouseId: "",
       };
       this.timeArr = [];

+ 27 - 26
src/views/product-material/spu/index.vue

@@ -12,17 +12,16 @@
       <el-table-column
         :label="$t('product_material.spu.spuCode')"
         align="center"
-        prop="productName"
+        prop="code"
       />
       <el-table-column
         :label="$t('product_material.spu.spuName')"
         align="center"
-        prop="applicationName"
+        prop="name"
       />
       <el-table-column
         :label="$t('product_material.spu.spuDescription')"
         align="center"
-        prop="applicationName"
       />
 
       <el-table-column :label="$t('operation')" align="center" width="120">
@@ -70,7 +69,7 @@
 import test from "@/components/form-test/index.vue";
 import addSpu from "./addSpu.vue";
 import query from "@/components/query/index.vue";
-import * as API from "@/api/product-material/product/index.js";
+import * as API from "@/api/product-material/spu/index.js";
 export default {
   components: {
     test,
@@ -83,8 +82,6 @@ export default {
         pageNum: 1,
         pageSize: 10,
         keyword: "",
-        tdaApplicationId: "",
-        tdaProductId: "",
       },
       queryForm: {
         otherButton: {
@@ -100,9 +97,9 @@ export default {
           ],
         },
       },
-      tableList: [{}],
+      tableList: [],
       loading: false,
-      total: 3,
+      total: null,
       open: false,
       titleText: "add",
       form: {
@@ -112,28 +109,36 @@ export default {
       },
     };
   },
-  created() {},
+  created() {
+    this.getList();
+  },
   methods: {
     handleEdit(row) {
       this.titleText = "edit";
+      this.form = row;
       this.open = true;
     },
     getList() {
       this.loading = true;
-      API.tdaDevicePage(this.queryParams).then(
+      API.spuList(this.queryParams).then(
         (res) => {
           this.total = res.data.data.total;
           this.tableList = res.data.data.records;
           this.loading = false;
         },
         (err) => {
-          console.log("tdaDevicePage: " + err);
+          console.log("spuList: " + err);
           this.loading = false;
         }
       );
     },
     spuAdd() {
       this.titleText = "add";
+      this.form = {
+        code: "",
+        name: "",
+        productCombinationList: [],
+      };
       this.open = true;
     },
     handleQuery() {
@@ -141,41 +146,37 @@ export default {
     },
     handleCancel() {
       this.form = {
-        classifyId: "",
-        type: "",
         code: "",
         name: "",
-        unit: "",
-        introduce: "",
-        deptId: "",
+        productCombinationList: [],
       };
       this.open = false;
     },
     handleSubmit() {
-      if (this.form.id) {
-        API.materialAdd(this.form).then(
+      if (!this.form.id) {
+        API.spuAdd(this.form).then(
           () => {
             this.msgSuccess(this.$t("addSuccess"));
-            this.$refs.addProduct.loading = false;
+            this.$refs.addSpu.loading = false;
             this.open = false;
             this.getList();
           },
           (err) => {
-            console.log("materialAdd: " + err);
-            this.$refs.addProduct.loading = false;
+            console.log("spuAdd: " + err);
+            this.$refs.addSpu.loading = false;
           }
         );
       } else {
-        API.materialEdit(this.form).then(
+        API.spuEdit(this.form).then(
           () => {
             this.msgSuccess(this.$t("editSuccess"));
             this.open = false;
-            this.$refs.addProduct.loading = false;
+            this.$refs.addSpu.loading = false;
             this.getList();
           },
           (err) => {
-            console.log("materialEdit: " + err);
-            this.$refs.addProduct.loading = false;
+            console.log("spuEdit: " + err);
+            this.$refs.addSpu.loading = false;
           }
         );
       }
@@ -186,7 +187,7 @@ export default {
         cancelButtonText: this.$t("cancelText"),
         type: "warning",
       }).then(() => {
-        API.tdaDeviceDelete({ id: row.id }).then(() => {
+        API.spuDel({ id: row.id }).then(() => {
           this.msgSuccess(this.$t("deleteSuccess"));
           this.getList();
         });

+ 294 - 0
src/views/purchase-management/deliver-goods/index.vue

@@ -0,0 +1,294 @@
+
+
+<script>
+import query from "@/components/query/index.vue";
+import sendGoods from "./sendGoods.vue";
+import * as API from "@/api/purchase-management/deliver-goods/index.js";
+
+export default {
+  components: {
+    query,
+    sendGoods,
+  },
+  data() {
+    return {
+      purchaseStatusList: [],
+      productTypeList: [],
+      supplySelectList: [],
+      supplyTypeList: [],
+      btnForm: {
+        otherButton: {
+          list: [
+            {
+              name: this.$t("purchase_management.purchase.purchase"),
+              methodsText: "add",
+              type: "primary",
+              add: () => {
+                this.handlePurchases();
+              },
+            },
+            {
+              name: this.$t("purchase_management.purchase.deliverGoods"),
+              methodsText: "deliverGoods",
+              type: "primary",
+              deliverGoods: () => {
+                this.deliverGoods();
+              },
+            },
+          ],
+        },
+      },
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        status: "",
+        code: "",
+      },
+      selectConfig: [
+        {
+          label: "发货状态",
+          prop: "type",
+          data: [],
+        },
+      ],
+      tableList: [{}],
+      loading: false,
+      titleText: "",
+      open: false,
+      form: {
+        id: "",
+        receiptWarehouseId: "",
+        planArrivalTime: "",
+        cause: "",
+        goodsId: [],
+      },
+      selectData: [],
+    };
+  },
+  created() {
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.purchaseStatusList = businessDictData.find(
+      (item) => item.code === "purchaseStatus"
+    ).children;
+    this.selectConfig[0].data = this.purchaseStatusList
+      .filter((x) => Number(x.dictKey) > 20)
+      .map((item) => ({
+        label: item.dictValue,
+        value: item.dictKey,
+      }));
+
+    // this.getList();
+  },
+  methods: {
+    deliverGoods() {
+      this.$router.push({
+        path: "/purchase-management/deliver-goods/index",
+      });
+    },
+    getList() {
+      this.loading = true;
+      API.deliveryList(this.queryParams).then(
+        (res) => {
+          this.tableList = res.data.data.records;
+          this.total = res.data.data.total;
+          this.loading = false;
+        },
+        (err) => {
+          console.log("purchaseList: " + err);
+          this.loading = false;
+        }
+      );
+    },
+    handleQuery() {
+      this.getList();
+    },
+    handleSelectionChange(arr) {
+      this.selectData = arr;
+    },
+    handleSend(row) {
+      this.form = {
+        purchaseId: "",
+        code: "",
+        details: [
+          { purchaseId: "", applyPurchaseId: "", shipmentQuantity: "" },
+        ],
+        fileInfos: [],
+      };
+      this.titleText = "发货";
+      this.open = true;
+    },
+
+    handleCancel() {
+      this.form = {
+        purchaseId: "",
+        code: "",
+        details: [
+          { purchaseId: "", applyPurchaseId: "", shipmentQuantity: "" },
+        ],
+        fileInfos: [],
+      };
+      this.open = false;
+    },
+    handleSubmit() {
+      API.deliveryAdd(this.form).then(
+        () => {
+          this.msgSuccess(this.$t("addSuccess"));
+          this.$refs.sendGoods.loading = false;
+          this.open = false;
+          this.getList();
+        },
+        (err) => {
+          console.log("sendPurchase: " + err);
+          this.$refs.sendGoods.loading = false;
+        }
+      );
+    },
+    handleComplete(row) {
+      this.$confirm(this.$t("askDeleteData"), {
+        confirmButtonText: this.$t("submitText"),
+        cancelButtonText: this.$t("cancelText"),
+        type: "warning",
+      }).then(() => {
+        API.completePurchase({ id: row.id }).then(() => {
+          this.msgSuccess(this.$t("deleteSuccess"));
+          this.getList();
+        });
+      });
+    },
+    handleSeeDeatils(row) {
+      API.purchaseDetails({ id: row.id }).then((res) => {
+        console.log(res, "ssde");
+      });
+    },
+    handleDelete(row) {
+      this.$confirm(this.$t("askDeleteData"), {
+        confirmButtonText: this.$t("submitText"),
+        cancelButtonText: this.$t("cancelText"),
+        type: "warning",
+      }).then(() => {
+        API.purchaseDel({ id: row.id }).then(() => {
+          this.msgSuccess(this.$t("deleteSuccess"));
+          this.getList();
+        });
+      });
+    },
+    isSelectable(row) {
+      if (row.status != 30) {
+        return false;
+      } else {
+        return true;
+      }
+    },
+    showAddress(row) {
+      return (
+        <div>
+          {row.countryName} , {row.provinceName} , {row.cityName}
+        </div>
+      );
+    },
+  },
+};
+</script>
+
+
+<template>
+  <div>
+    <el-card class="box-card">
+      <query
+        :selectConfig="selectConfig"
+        :req="queryParams"
+        :isShowMore="false"
+        @handleQuery="handleQuery"
+        @handleMore="
+          () => {
+            queryDialog = true;
+          }
+        "
+      ></query>
+      <el-table
+        :data="tableList"
+        v-loading="loading"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column
+          type="selection"
+          width="50"
+          align="center"
+          :selectable="isSelectable"
+        >
+        </el-table-column>
+        <el-table-column
+          label="采购单号"
+          align="center"
+          prop="code"
+          width="150"
+        >
+          <template slot-scope="scope">
+            <span style="color: #0084ff; cursor: pointer">
+              {{ scope.row.code }}
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column label="总金额" align="center" prop="price" />
+        <el-table-column
+          label="要求到货时间"
+          align="center"
+          prop="createTime"
+          width="160"
+        />
+        <el-table-column
+          label="采购状态"
+          align="center"
+          :formatter="(row) => dictDataEcho(row.status, purchaseStatusList)"
+        />
+        <el-table-column label="采购人" align="center" prop="createName" />
+
+        <el-table-column :label="$t('operation')" align="center" width="120">
+          <!-- v-if="scope.row.status === 30" -->
+          <template slot-scope="scope">
+            <el-button type="text" @click="handleSend(scope.row)"
+              >发货
+            </el-button>
+            <el-button
+              type="text"
+              v-if="scope.row.status === 40"
+              @click="handleComplete(scope.row)"
+              >完成采购
+            </el-button>
+            <el-button
+              type="text"
+              v-if="scope.row.status === 50"
+              @click="handleSeeDeatils(scope.row)"
+              >查看
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-card>
+
+    <el-dialog
+      :title="titleText"
+      :visible.sync="open"
+      v-if="open"
+      width="80%"
+      top="60px"
+    >
+      <send-goods
+        :form="form"
+        @submit="handleSubmit"
+        @cancel="handleCancel"
+        ref="sendGoods"
+      ></send-goods>
+    </el-dialog>
+  </div>
+</template>
+
+
+<style lang="scss" scoped>
+.box-card {
+  height: calc(100vh - 110px);
+  overflow-y: auto;
+}
+</style>

+ 179 - 0
src/views/purchase-management/deliver-goods/sendGoods.vue

@@ -0,0 +1,179 @@
+<template>
+  <div v-loading="loading">
+    <div class="form-box">
+      <el-form
+        label-position="top"
+        :model="form"
+        ref="form"
+        :rules="formRules"
+        label-width="100px"
+      >
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="物流单号" prop="code">
+              <el-input
+                v-model="form.code"
+                :placeholder="$t('pleaseInput')"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-form-item label="上传附件">
+          <el-upload
+            class="upload-demo"
+            action="http://36.134.91.96:10001/api/service-file/uploadFile"
+            :headers="uploadHeader"
+            :on-preview="handlePreview"
+            :on-remove="handleRemove"
+            :on-success="handleSuccess"
+            multiple
+            :file-list="fileList"
+          >
+            <el-button size="small" type="primary">点击上传</el-button>
+          </el-upload>
+        </el-form-item>
+
+        <el-form-item>
+          <el-table :data="form.details">
+            <el-table-column label="申购单号" prop="goodsCode">
+            </el-table-column>
+            <el-table-column
+              :label="$t('purchase_management.purchase.goodCode')"
+              prop="goodsCode"
+            >
+            </el-table-column>
+            <el-table-column
+              :label="$t('purchase_management.purchase.goodName')"
+              prop="goodsName"
+            >
+            </el-table-column>
+
+            <el-table-column
+              :label="$t('purchase_management.purchase.unit')"
+              prop="goodsUnit"
+            >
+            </el-table-column>
+            <el-table-column
+              :label="$t('purchase_management.purchase.subscribeQuantity')"
+              prop="quantity"
+            >
+            </el-table-column>
+            <el-table-column label="收货仓库" prop="stockQuantity">
+            </el-table-column>
+            <el-table-column label="发货数量" prop="shipmentQuantity">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'details.' + scope.$index + '.shipmentQuantity'"
+                  :rules="formRules.shipmentQuantity"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input
+                    v-model="scope.row.shipmentQuantity"
+                    :placeholder="$t('pleaseInput')"
+                    size="mini"
+                  >
+                  </el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+
+            <el-table-column
+              :label="$t('operation')"
+              width="100"
+              align="center"
+            >
+              <template slot-scope="scope">
+                <el-button type="text" @click="deleteRow(scope.$index)">{{
+                  $t("delete")
+                }}</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div style="text-align: center; margin-top: 15px">
+      <el-button size="small" @click="handleCancel"
+        >{{ $t("cancel") }}
+      </el-button>
+      <el-button type="primary" size="small" @click="handleSubmit">
+        {{ $t("submit") }}</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<script>
+import labelTitle from "@/components/label-title/index.vue";
+
+import { getToken } from "@/util/auth";
+
+export default {
+  name: "addPurchase",
+  components: { labelTitle },
+  props: {
+    form: {
+      type: Object,
+      default: () => {},
+    },
+  },
+  data() {
+    return {
+      uploadHeader: {
+        Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
+        "Blade-Auth": "bearer " + getToken(),
+      },
+      fileList: [],
+      loading: false,
+      formRules: {
+        code: [
+          {
+            required: true,
+            message: "请输入物流单号",
+            trigger: "blur",
+          },
+        ],
+        shipmentQuantity: [
+          {
+            required: true,
+            message: "请输入发货数量",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  created() {},
+  methods: {
+    handleSubmit() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.loading = true;
+          this.$emit("submit");
+        }
+      });
+    },
+    handleCancel() {
+      this.$emit("cancel");
+    },
+    handleSuccess(response, file, fileList) {
+      this.form.fileInfoList = fileList;
+    },
+    handleRemove(response, file, fileList) {
+      this.form.fileInfoList = fileList;
+    },
+    handlePreview() {},
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.form-box {
+  height: calc(100vh - 280px);
+  overflow: auto;
+  box-sizing: border-box;
+  padding: 10px;
+}
+</style>

+ 17 - 5
src/views/purchase-management/purchase/index.vue

@@ -100,10 +100,12 @@ export default {
     this.purchaseStatusList = businessDictData.find(
       (item) => item.code === "purchaseStatus"
     ).children;
-    this.selectConfig[0].data = this.purchaseStatusList.map((item) => ({
-      label: item.dictValue,
-      value: item.dictKey,
-    }));
+    this.selectConfig[0].data = this.purchaseStatusList
+      .filter((x) => x.dictKey === "10" || x.dictKey === "20")
+      .map((item) => ({
+        label: item.dictValue,
+        value: item.dictKey,
+      }));
 
     this.supplyTypeList = businessDictData.find(
       (item) => item.code === "supplyType"
@@ -115,6 +117,11 @@ export default {
     this.getList();
   },
   methods: {
+    deliverGoods() {
+      this.$router.push({
+        path: "/purchase-management/deliver-goods/index",
+      });
+    },
     getList() {
       this.loading = true;
       API.purchaseList(this.queryParams).then(
@@ -274,7 +281,12 @@ export default {
         v-loading="loading"
         @selection-change="handleSelectionChange"
       >
-        <el-table-column type="selection" width="50" :selectable="isSelectable">
+        <el-table-column
+          type="selection"
+          width="50"
+          align="center"
+          :selectable="isSelectable"
+        >
         </el-table-column>
         <el-table-column
           :label="$t('purchase_management.purchase.subscribeOddNumbers')"

+ 1 - 1
src/views/purchase-management/subscribe/index.vue

@@ -79,7 +79,7 @@ export default {
       (item) => item.code === "productType"
     ).children;
     this.subscribeStatusList = businessDictData.find(
-      (item) => item.code === "subscribeStatus"
+      (item) => item.code === "purchaseStatus"
     ).children;
     this.warehouseTypeList = businessDictData.find(
       (item) => item.code === "warehouseType"

+ 2 - 1
src/views/purchase-management/subscribe/sendSubscribe.vue

@@ -183,12 +183,13 @@
 import labelTitle from "@/components/label-title/index.vue";
 import selectProduct from "@/components/select-product/index.vue";
 import selectMaterial from "@/components/select-material/index.vue";
+import selectGood from "@/components/select-good/index.vue";
 
 import { getToken } from "@/util/auth";
 
 export default {
   name: "addCustomer",
-  components: { labelTitle, selectProduct, selectMaterial },
+  components: { labelTitle, selectProduct, selectMaterial, selectGood },
   props: {
     form: {
       type: Object,