Browse Source

待入库完成

cz 2 years ago
parent
commit
f9f404e68a

+ 21 - 0
src/api/inbound-outbound/treatIn.js

@@ -0,0 +1,21 @@
+import request from '@/router/axios'
+
+// 待入库列表 
+export function inList(data = {}) {
+  return request({
+    url: '/api/victoriatourist/logisticsInfo/issuePage',
+    method: 'post',
+    data: data,
+  })
+}
+
+
+
+// 京东退货入库
+export function JDInBound(data = {}) {
+  return request({
+    url: '/api/victoriatourist/newJdBack/add',
+    method: 'post',
+    data: data,
+  })
+}

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

@@ -531,6 +531,17 @@ export default [{
     }, ],
   },
   {
+    path: '/inbound-outbound/transfer',
+    component: Layout,
+    redirect: '/inbound-outbound/transfer/JDtransfer',
+    children: [{
+      path: 'JDtransfer',
+      name: '京东订单调仓',
+      component: () => import( /* webpackChunkName: "page" */ '@/views/inbound-outbound/transfer/JDtransfer'),
+      props: true,
+    }, ],
+  },
+  {
     path: '/inbound-outbound/flow',
     component: Layout,
     redirect: '/inbound-outbound/flow/index',

+ 314 - 0
src/views/inbound-outbound/transfer/JDtransfer.vue

@@ -0,0 +1,314 @@
+
+
+<script>
+import test from "@/components/form-test/index.vue";
+import query from "@/components/query/index.vue";
+
+import * as API from "@/api/inbound-outbound/transfer.js";
+
+import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
+import sendTransfer from "./sendTransfer.vue";
+
+export default {
+  components: {
+    test,
+    query,
+    sendTransfer,
+  },
+  data() {
+    return {
+      warehouseSelectList: [],
+      warehouseTypeList: [],
+      btnForm: {
+        otherButton: {
+          list: [
+            {
+              name: "发起调仓",
+              methodsText: "send",
+              type: "primary",
+              send: () => {
+                this.handleSend();
+              },
+            },
+          ],
+        },
+      },
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        type: "1",
+        keyword: "",
+        outWarehouseId: "",
+        inWarehouseId: "",
+        inStatus: "",
+      },
+      selectConfig: [
+        {
+          label: "调出仓库",
+          prop: "outWarehouseId",
+          data: [],
+        },
+        {
+          label: "调入仓库",
+          prop: "inWarehouseId",
+          data: [],
+        },
+        {
+          label: "调仓状态",
+          prop: "inStatus",
+          data: [],
+        },
+      ],
+      tableList: [],
+      total: 0,
+      loading: false,
+      titleText: "发起调仓",
+      open: false,
+      form: {
+        outWarehouseId: "",
+        inWarehouseId: "",
+        remark: "",
+        changeProductList: [],
+      },
+    };
+  },
+  created() {
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.warehouseTypeList = businessDictData.find(
+      (item) => item.code === "warehouseType"
+    ).children;
+    warehouseSelectList().then((res) => {
+      this.warehouseSelectList = res.data.data;
+      this.selectConfig[0].data = this.warehouseSelectList.map((item) => ({
+        label: item.name,
+        value: item.id,
+      }));
+      this.selectConfig[1].data = this.warehouseSelectList.map((item) => ({
+        label: item.name,
+        value: item.id,
+      }));
+    });
+    this.selectConfig[2].data = [
+      {
+        label: "待接收",
+        value: "0",
+      },
+      {
+        label: "已接收",
+        value: "1",
+      },
+    ];
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+      API.transferList(this.queryParams).then(
+        (res) => {
+          this.tableList = res.data.data.records;
+          this.total = res.data.data.total;
+          this.loading = false;
+        },
+        (err) => {
+          console.log("transferList: " + err);
+          this.loading = false;
+        }
+      );
+    },
+    handleQuery() {
+      this.getList();
+    },
+    handleSend() {
+      this.form = {
+        outWarehouseId: "",
+        inWarehouseId: "",
+        remark: "",
+        changeProductList: [],
+      };
+      this.open = true;
+    },
+    handleCancel() {
+      this.form = {
+        outWarehouseId: "",
+        inWarehouseId: "",
+        remark: "",
+        changeProductList: [],
+      };
+      this.open = false;
+    },
+
+    handleSubmit() {
+      API.sendTransfer(this.form).then(
+        () => {
+          this.msgSuccess("添加成功");
+          this.$refs.sendTransfer.loading = false;
+          this.open = false;
+          this.getList();
+        },
+        (err) => {
+          console.log("sendTransfer: " + err);
+          this.$refs.sendTransfer.loading = false;
+        }
+      );
+    },
+    handleReceive(row) {
+      this.$confirm("是否确认接收 ?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        API.receive({ id: row.id, inQuantity: row.outQuantity }).then(() => {
+          this.msgSuccess("接收成功");
+          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="物品编码"
+          align="left"
+          prop="code"
+          width="150"
+        />
+        <el-table-column label="物品名称" align="left" prop="name" />
+        <el-table-column label="规格" align="left" prop="specs" />
+        <el-table-column
+          label="调出仓库"
+          align="left"
+          prop="outWarehouseName"
+          width="150"
+        />
+        <el-table-column
+          label="调出数量"
+          align="left"
+          prop="outQuantity"
+          width="110"
+        />
+        <el-table-column
+          label="操作人"
+          align="left"
+          prop="outUserName"
+          width="120"
+        />
+        <el-table-column
+          label="调入仓库"
+          align="left"
+          prop="inWarehouseName"
+          width="150"
+        />
+        <el-table-column
+          label="接收数量"
+          align="left"
+          prop="inQuantity"
+          width="120"
+        />
+        <el-table-column
+          label="接收人"
+          align="left"
+          prop="inUserName"
+          width="120"
+        />
+        <el-table-column
+          label="状态"
+          align="left"
+          prop="inStatus"
+          width="100"
+          :formatter="
+            (row) => {
+              if (row.inStatus === 0) {
+                return '待接收';
+              } else {
+                return '已接收';
+              }
+            }
+          "
+        />
+        <el-table-column label="操作" align="center" width="120">
+          <template slot-scope="scope">
+            <el-button
+              type="text"
+              v-if="scope.row.inStatus === 0"
+              @click="handleReceive(scope.row)"
+              >接收
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </el-card>
+
+    <el-dialog
+      :title="titleText"
+      :visible.sync="open"
+      v-if="open"
+      width="80%"
+      top="60px"
+    >
+      <send-transfer
+        :form="form"
+        :warehouseSelectList="warehouseSelectList"
+        :warehouseTypeList="warehouseTypeList"
+        @submit="handleSubmit"
+        @cancel="handleCancel"
+        ref="sendTransfer"
+      ></send-transfer>
+    </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;
+    overflow-y: auto;
+  }
+}
+</style>

+ 1 - 0
src/views/inbound-outbound/transfer/index.vue

@@ -37,6 +37,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         keyword: "",
+        type: "",
         outWarehouseId: "",
         inWarehouseId: "",
         inStatus: "",

+ 148 - 0
src/views/inbound-outbound/treatIn/JDbackInbound.vue

@@ -0,0 +1,148 @@
+<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 :gutter="10">
+          <el-col :span="6">
+            <el-form-item label="仓库名称" prop="warehouseId">
+              <el-select
+                v-model="form.warehouseId"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <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-row :gutter="10">
+          <el-col :span="4">
+            <el-form-item label="物流公司" prop="logisticsCompanyName">
+              <el-input v-model="form.logisticsCompanyName" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="物流/快递单号" prop="code">
+              <el-input v-model="form.code" disabled></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <div style="margin-bottom: 20px">
+          <labelTitle content="退货明细"></labelTitle>
+        </div>
+        <el-form-item>
+          <el-table :data="form.logisticsDetailsList">
+            <el-table-column label="退货单号" prop="backCode" />
+            <el-table-column label="申请时间" prop="applicationTime" />
+            <el-table-column label="备件条码" prop="spareParts" />
+            <el-table-column label="UPC码" prop="upcCode" />
+            <el-table-column label="商品编号" prop="productCode" />
+            <el-table-column label="商品名称" prop="productName" />
+            <el-table-column label="备件库" prop="sparePartsStore" />
+          </el-table>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div style="text-align: center; margin-top: 15px">
+      <el-button size="small" @click="handleCancel">取消 </el-button>
+      <el-button type="primary" size="small" @click="handleSubmit">
+        确定</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<script>
+import labelTitle from "@/components/label-title/index.vue";
+import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
+
+export default {
+  name: "JDbackInbound",
+  components: { labelTitle },
+  props: {
+    form: {
+      type: Object,
+      default: () => {},
+    },
+  },
+  data() {
+    return {
+      warehouseSelectList: [],
+      warehouseTypeList: [],
+      loading: false,
+      formRules: {
+        warehouseId: [
+          {
+            required: true,
+            message: "请选择物仓库名称",
+            trigger: "change",
+          },
+        ],
+      },
+
+      selectDialog: false,
+      warehouseName: "",
+    };
+  },
+  created() {
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+
+    this.warehouseTypeList = businessDictData.find(
+      (item) => item.code === "warehouseType"
+    ).children;
+    warehouseSelectList().then((res) => {
+      this.warehouseSelectList = res.data.data;
+    });
+  },
+  methods: {
+    handleSubmit() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.loading = true;
+          this.$emit("submit");
+        }
+      });
+    },
+    handleCancel() {
+      this.$emit("cancel");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.form-box {
+  height: calc(100vh - 280px);
+  overflow: auto;
+  box-sizing: border-box;
+  padding: 10px;
+}
+::v-deep {
+  .el-form-item {
+    margin-bottom: 3px;
+  }
+  .el-form--label-top .el-form-item__label {
+    padding: 8px 0 0 0;
+  }
+}
+</style>

+ 139 - 110
src/views/inbound-outbound/treatIn/index.vue

@@ -4,35 +4,34 @@
 import test from "@/components/form-test/index.vue";
 import query from "@/components/query/index.vue";
 import purchaseInbound from "./purchaseInbound.vue";
+import JDbackInbound from "./JDbackInbound.vue";
 
-import * as API from "@/api/inbound-outbound/outbound/salesOutbound.js";
-import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
+import * as API from "@/api/inbound-outbound/treatIn.js";
+import {
+  logisticsDetails,
+  purchaseAdd,
+} from "@/api/inbound-outbound/inbound/purchaseInbound.js";
+import { JDreGoodsDetails } from "@/api/order-management/JDReturnGoods/index.js";
 
 export default {
   components: {
     test,
     query,
     purchaseInbound,
+    JDbackInbound,
   },
   data() {
     return {
-      orderTypeList: [],
-      warehouseTypeList: [],
-      warehouseSelectList: [],
-      outboundTypeList: [],
+      inBoundTypeList: [
+        { dictValue: "采购入库", dictKey: "1" },
+        { dictValue: "京东退货", dictKey: "4" },
+      ],
+      inStockStatusList: [],
       queryParams: {
         pageNum: 1,
         pageSize: 10,
         keyword: "",
         type: "",
-        status: "",
-        code: "",
-        customerName: "",
-        minAmountMoney: "",
-        maxAmountMoney: "",
-        countryId: "",
-        provinceId: "",
-        cityId: "",
       },
       selectConfig: [
         {
@@ -40,7 +39,7 @@ export default {
           prop: "type",
           data: [
             { label: "采购入库", value: "1" },
-            { label: "京东退货", value: "0" },
+            { label: "京东退货", value: "4" },
           ],
         },
       ],
@@ -49,14 +48,9 @@ export default {
       loading: false,
       titleText: "",
       open: false,
-      form: {
-        orderId: "",
-        warehouseId: "",
-        logisticsCode: "",
-        logisticsCompanyCode: "",
-        orderDetailsList: [],
-      },
-      addType: "",
+      form: {},
+
+      rowData: {},
     };
   },
   created() {
@@ -64,28 +58,28 @@ export default {
       window.localStorage.getItem("businessDict")
     );
 
-    this.warehouseTypeList = businessDictData.find(
-      (item) => item.code === "warehouseType"
+    this.inStockStatusList = businessDictData.find(
+      (item) => item.code === "inStockStatus"
     ).children;
-    this.outboundTypeList = businessDictData.find(
-      (item) => item.code === "outboundType"
-    ).children;
-    warehouseSelectList().then((res) => {
-      this.warehouseSelectList = res.data.data;
-    });
+
+    this.selectConfig[0].data = this.inBoundTypeList.map((x) => ({
+      value: x.dictKey,
+      label: x.dictValue,
+    }));
+
     this.getList();
   },
   methods: {
     getList() {
       this.loading = true;
-      API.salesOrderList(this.queryParams).then(
+      API.inList(this.queryParams).then(
         (res) => {
           this.tableList = res.data.data.records;
           this.total = res.data.data.total;
           this.loading = false;
         },
         (err) => {
-          console.log("salesOrderList: " + err);
+          console.log("inList: " + err);
           this.loading = false;
         }
       );
@@ -93,73 +87,91 @@ export default {
     handleQuery() {
       this.getList();
     },
-    handleInbound(row, type = "") {
-      this.addType = type;
+    handleInbound(row) {
+      this.rowData = { ...row };
       this.open = true;
-      this.$nextTick(() => {
-        this.$refs.addOutbound.loading = true;
-        API.getOrderDetails({ id: row.id }).then(
-          (res) => {
-            const productDetailsList = res.data.data.map((x) => ({
-              productCode: x.productCode,
-              productName: x.productName,
-              notIssuedQuantity: x.notIssuedQuantity,
-              specs: x.productSpecs,
-              changeQuantity: Number(x.notIssuedQuantity),
-              productId: x.productId,
-              orderDetailsId: x.id,
-            }));
+      if (row.businessType === 1) {
+        this.titleText = "采购入库";
+        this.$nextTick(() => {
+          this.$refs.purchaseInbound.loading = true;
+          logisticsDetails({ logisticsInfoId: row.id }).then(
+            (res) => {
+              let list = res.data.data;
+              list = list.map((x) => ({
+                ...x,
+                changeQuantity:
+                  Number(x.shipmentQuantity) - Number(x.receiptQuantity),
+              }));
+              this.form = {
+                id: row.id,
+                purchaseCode: row.purchaseCode,
+                supplierName: row.supplierName,
+                logisticsCompanyName: row.logisticsCompanyName,
+                code: row.code,
+                changeDetailsList: list,
+              };
+              this.$refs.purchaseInbound.loading = false;
+            },
+            (err) => {
+              console.log("logisticsDetails: " + err);
+              this.$refs.purchaseInbound.loading = false;
+            }
+          );
+        });
+      } else if (row.businessType === 4) {
+        this.titleText = "京东退货入库";
+        this.$nextTick(() => {
+          this.$refs.JDbackInbound.loading = true;
+          JDreGoodsDetails({ id: row.businessId }).then((res) => {
             this.form = {
-              customerName: row.customerName,
-              orderType: String(row.type),
-              orderCode: row.code,
-              type: "4",
-              orderId: row.id,
+              logisticsId: row.id,
               warehouseId: "",
-              logisticsCode: "",
-              logisticsCompanyCode: "",
-              orderDetailsList: productDetailsList,
+              logisticsCompanyName: row.logisticsCompanyName,
+              code: row.code,
+              logisticsDetailsList: res.data.data,
             };
-            this.$refs.addOutbound.loading = false;
-          },
-          (err) => {
-            console.log("getOrderDetails: " + err);
-            this.$refs.addOutbound.loading = false;
-          }
-        );
-      });
+            this.$refs.JDbackInbound.loading = false;
+          });
+        });
+      }
     },
     handleCancel() {
       this.open = false;
     },
     handleSubmit() {
-      API.salesOutbound(this.form).then(
-        () => {
-          this.msgSuccess("添加成功");
-          this.$refs.addOutbound.loading = false;
-          this.open = false;
-          this.getList();
-        },
-        (err) => {
-          console.log("outboundAdd: " + err);
-          this.$refs.addOutbound.loading = false;
-        }
-      );
-    },
-
-    showAddress(row) {
-      return (
-        <div>
-          {row.countryName} , {row.provinceName} , {row.cityName} ,
-          {row.detailedAddress}
-        </div>
-      );
-    },
-    showOutboundStatus(row) {
-      if (row.issueStatus === 1) {
-        return "未出库";
-      } else if (row.issueStatus === 2) {
-        return "部分出库";
+      if (this.rowData.businessType === 1) {
+        purchaseAdd({
+          logisticsInfoId: this.form.id,
+          list: this.form.changeDetailsList,
+        }).then(
+          () => {
+            this.msgSuccess("入库成功");
+            this.$refs.purchaseInbound.loading = false;
+            this.open = false;
+            this.getList();
+          },
+          (err) => {
+            console.log("purchaseAdd: " + err);
+            this.$refs.purchaseInbound.loading = false;
+          }
+        );
+      } else {
+        const data = {
+          logisticsId: this.form.logisticsId,
+          warehouseId: this.form.warehouseId,
+        };
+        API.JDInBound(data).then(
+          () => {
+            this.msgSuccess("入库成功");
+            this.$refs.JDbackInbound.loading = false;
+            this.open = false;
+            this.getList();
+          },
+          (err) => {
+            console.log("outboundAdd: " + err);
+            this.$refs.JDbackInbound.loading = false;
+          }
+        );
       }
     },
   },
@@ -185,51 +197,58 @@ export default {
         <el-table-column
           label="类型"
           align="left"
-          prop="type"
+          prop="businessType"
           width="120"
-          :formatter="(row) => dictDataEcho(row.type, orderTypeList)"
+          :formatter="(row) => dictDataEcho(row.businessType, inBoundTypeList)"
         />
         <el-table-column
           label="仓库名称"
           align="left"
-          prop="code"
+          prop="warehouseName"
           width="150"
         />
-        <el-table-column label="单号" align="left" prop="customerName" />
-        <el-table-column label="物流/快递公司" align="left" />
         <el-table-column
-          label="物流/快递单号"
+          label="单号"
           align="left"
-          prop="orderTime"
-          width="160"
+          prop="purchaseCode"
+          width="180"
         />
         <el-table-column
+          label="物流/快递公司"
+          align="left"
+          prop="logisticsCompanyName"
+          width="150"
+        />
+        <el-table-column label="物流/快递单号" align="left" prop="code" />
+        <el-table-column
           label="操作人"
           align="left"
-          prop="issueStatus"
-          width="100"
+          prop="purchaseName"
+          width="120"
         />
         <el-table-column
           label="操作时间"
           align="left"
-          prop="issueStatus"
-          width="100"
+          prop="updateTime"
+          width="150"
         />
         <el-table-column
           label="状态"
           align="left"
-          prop="issueStatus"
+          prop="inStockStatus"
           width="100"
+          :formatter="
+            (row) => dictDataEcho(row.inStockStatus, inStockStatusList)
+          "
         />
-
         <el-table-column label="操作" align="center" width="120">
           <template slot-scope="scope">
-            <el-button type="text" @click="handleInbound(scope.row)"
+            <el-button
+              type="text"
+              @click="handleInbound(scope.row)"
+              v-if="scope.row.status < 30"
               >入库
             </el-button>
-            <!-- <el-button type="text" @click="handleInbound(scope.row, '10')"
-              >补发货
-            </el-button> -->
           </template>
         </el-table-column>
       </el-table>
@@ -250,11 +269,21 @@ export default {
       top="60px"
     >
       <purchase-inbound
+        v-if="rowData.businessType === 1"
         :form="form"
         @submit="handleSubmit"
         @cancel="handleCancel"
-        ref="addOutbound"
+        ref="purchaseInbound"
       ></purchase-inbound>
+
+      <JDbackInbound
+        v-else
+        :form="form"
+        @submit="handleSubmit"
+        @cancel="handleCancel"
+        ref="JDbackInbound"
+      >
+      </JDbackInbound>
     </el-dialog>
   </div>
 </template>

+ 182 - 67
src/views/order-management/afterSales/addAfterSales.vue

@@ -8,24 +8,29 @@
         :rules="formRules"
         label-width="100px"
       >
-        <el-form-item label="客户名称" prop="customerInfoId">
-          <el-select
-            v-model="form.customerInfoId"
-            :disabled="!isAdd"
-            placeholder="请选择"
-            style="width: 100%"
-            @change="handleCustomerChange"
-          >
-            <el-option
-              v-for="item in customerSelectList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-row :gutter="10">
+        <div v-if="isAdd">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="客户名称" prop="customerInfoId">
+                <el-select
+                  v-model="form.customerInfoId"
+                  :disabled="!isAdd"
+                  placeholder="请选择"
+                  style="width: 100%"
+                  @change="handleCustomerChange"
+                >
+                  <el-option
+                    v-for="item in customerSelectList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- <el-row :gutter="10">
           <el-col :span="8">
             <el-form-item label="订单编号" prop="id">
               <el-select
@@ -52,28 +57,28 @@
               </el-button>
             </div>
           </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="售后类型" prop="type">
-              <el-select
-                v-model="form.type"
-                placeholder="请选择"
-                :disabled="!isAdd"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in afterSalesTypeList"
-                  :key="item.id"
-                  :label="item.dictValue"
-                  :value="item.dictKey"
+        </el-row> -->
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="售后类型" prop="type">
+                <el-select
+                  v-model="form.type"
+                  placeholder="请选择"
+                  :disabled="!isAdd"
+                  style="width: 100%"
                 >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-form-item label="售后原因" prop="remark" v-if="isAdd">
+                  <el-option
+                    v-for="item in afterSalesTypeList"
+                    :key="item.id"
+                    :label="item.dictValue"
+                    :value="item.dictKey"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- <el-form-item label="售后原因" prop="remark" v-if="isAdd">
           <el-input
             v-model="form.remark"
             :disabled="!isAdd"
@@ -82,21 +87,88 @@
             :rows="3"
           >
           </el-input>
-        </el-form-item>
-        <el-form-item label="售后原因" prop="remarkOne" v-else>
-          <el-input
-            v-model="form.remarkOne"
-            :disabled="!isAdd"
-            placeholder="请输入"
-            type="textarea"
-            :rows="3"
-          >
-          </el-input>
-        </el-form-item>
+        </el-form-item> -->
+          <el-form-item label="详细地址" required>
+            <el-row :gutter="10">
+              <el-col :span="8">
+                <el-form-item label-width="0" prop="countryId">
+                  <el-select
+                    v-model="form.countryId"
+                    placeholder="国家"
+                    style="width: 100%"
+                    @change="countryChange"
+                  >
+                    <el-option
+                      v-for="item in countryData"
+                      :key="item.id"
+                      :label="item.chineseName"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label-width="0" prop="provinceId">
+                  <el-select
+                    v-model="form.provinceId"
+                    placeholder="省/洲"
+                    style="width: 100%"
+                    @change="provinceChange"
+                    :disabled="!provinceData.length > 0"
+                  >
+                    <el-option
+                      v-for="item in provinceData"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label-width="0" prop="cityId">
+                  <el-select
+                    v-model="form.cityId"
+                    placeholder="城市"
+                    style="width: 100%"
+                    :disabled="!provinceData.length > 0 && !cityData.length > 0"
+                  >
+                    <el-option
+                      v-for="item in cityData"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row style="margin-top: 10px">
+              <el-form-item label-width="0" prop="detailedAddress">
+                <el-input
+                  v-model="form.detailedAddress"
+                  placeholder="详细地址"
+                ></el-input>
+              </el-form-item>
+            </el-row>
+          </el-form-item>
+          <el-form-item label="售后原因" prop="remarkOne">
+            <el-input
+              v-model="form.remarkOne"
+              placeholder="请输入"
+              type="textarea"
+              :rows="3"
+            >
+            </el-input>
+          </el-form-item>
+        </div>
 
-        <div style="margin-top: 20px" v-if="!isAdd">
+        <!-- <div style="margin-top: 20px" v-if="!isAdd">
           <labelTitle content="跟进记录"></labelTitle>
-        </div>
+        </div> -->
         <el-form-item label="售后状态" prop="afterSalesStatus" v-if="!isAdd">
           <el-select
             v-model="form.afterSalesStatus"
@@ -130,21 +202,23 @@
           >
           </el-input>
         </el-form-item>
-        <div style="margin-top: 20px">
-          <labelTitle content="售后明细"></labelTitle>
+        <div v-if="isAdd">
+          <div style="margin-top: 20px">
+            <labelTitle content="售后明细"></labelTitle>
+          </div>
+          <el-form-item label-width="0px">
+            <el-button type="primary" size="mini" @click="selectDialog = true">
+              添加商品</el-button
+            >
+          </el-form-item>
+          <el-form-item>
+            <el-table :data="form.productList">
+              <el-table-column label="产品名称" prop="productName" />
+              <el-table-column label="产品编号" prop="applicationTime" />
+              <el-table-column label="数量" prop="spareParts" />
+            </el-table>
+          </el-form-item>
         </div>
-        <el-form-item label-width="0px">
-          <el-button type="primary" size="mini" @click="selectDialog = true">
-            添加明细</el-button
-          >
-        </el-form-item>
-        <el-form-item>
-          <el-table :data="form.productList">
-            <el-table-column label="产品名称" prop="productName" />
-            <el-table-column label="产品编号" prop="applicationTime" />
-            <el-table-column label="备件条码" prop="spareParts" />
-          </el-table>
-        </el-form-item>
       </el-form>
     </div>
     <div style="text-align: center; margin-top: 15px">
@@ -181,6 +255,7 @@ import selectProduct from "@/components/select-product/index.vue";
 
 import { getToken } from "@/util/auth";
 import { getOrderCode } from "@/api/order-management/afterSales/index.js";
+import { getRegionData } from "@/api/system/common.js";
 
 export default {
   name: "addAfterSales",
@@ -219,7 +294,9 @@ export default {
       },
 
       loading: false,
-
+      countryData: [],
+      provinceData: [],
+      cityData: [],
       formRules: {
         customerInfoId: [
           {
@@ -257,6 +334,34 @@ export default {
             trigger: "blur",
           },
         ],
+        countryId: [
+          {
+            required: true,
+            message: "请选择国家",
+            trigger: "change",
+          },
+        ],
+        provinceId: [
+          {
+            required: true,
+            message: "请选择省/洲",
+            trigger: "change",
+          },
+        ],
+        cityId: [
+          {
+            required: true,
+            message: "请选择城市",
+            trigger: "change",
+          },
+        ],
+        detailedAddress: [
+          {
+            required: true,
+            message: "请输入详细地址",
+            trigger: "blur",
+          },
+        ],
       },
       orderList: [],
       selectDialog: false,
@@ -284,6 +389,16 @@ export default {
         }
       });
     },
+    countryChange(val) {
+      getRegionData({ parentId: val, type: "2" }).then((res) => {
+        this.provinceData = res.data.data;
+      });
+    },
+    provinceChange(val) {
+      getRegionData({ parentId: val, type: "3" }).then((res) => {
+        this.cityData = res.data.data;
+      });
+    },
     handleCancel() {
       this.$emit("cancel");
     },

+ 54 - 16
src/views/order-management/afterSales/index.vue

@@ -67,6 +67,7 @@ export default {
         remark: "",
       },
       isAdd: false,
+      openOne: false,
     };
   },
   created() {
@@ -131,7 +132,7 @@ export default {
       this.open = false;
     },
     handleFollow(row) {
-      this.titleText = "售后跟进";
+      this.titleText = "跟进";
       this.isAdd = false;
       this.form = {
         customerInfoId: row.customerInfoId,
@@ -186,6 +187,9 @@ export default {
         </div>
       );
     },
+    lookRecords() {
+      this.openOne = true;
+    },
   },
 };
 </script>
@@ -214,23 +218,18 @@ export default {
         <el-table-column
           label="售后类型"
           align="left"
-          width="120"
           :formatter="(row) => dictDataEcho(row.type, afterSalesTypeList)"
         />
-        <el-table-column label="订单编号" align="left" prop="code">
+        <!-- <el-table-column label="订单编号" align="left" prop="code">
           <template slot-scope="scope">
             <div class="show_underline">
               {{ scope.row.code }}
             </div>
           </template>
-        </el-table-column>
-        <el-table-column
-          label="客户名称"
-          align="left"
-          prop="customerName"
-          width="130"
-        />
-        <el-table-column
+        </el-table-column> -->
+        <el-table-column label="客户名称" align="left" prop="customerName" />
+        <el-table-column label="售货原因" align="left" prop="" />
+        <!-- <el-table-column
           label="订单金额"
           align="left"
           prop="amountMoney"
@@ -254,23 +253,25 @@ export default {
           align="left"
           prop="createTime"
           width="150"
-        />
+        /> -->
         <el-table-column
           label="状态"
           align="left"
-          width="120"
           :formatter="
             (row) => dictDataEcho(row.afterSalesStatus, afterSalesStatusList)
           "
         />
-        <el-table-column
+        <!-- <el-table-column
           label="订单状态"
           align="left"
           width="120"
           :formatter="(row) => dictDataEcho(row.status, orderStatusList)"
-        />
-        <el-table-column label="操作" align="center" width="120">
+        /> -->
+        <el-table-column label="操作" align="center" width="160">
           <template slot-scope="scope">
+            <el-button type="text" @click="lookRecords(scope.row)"
+              >跟进记录
+            </el-button>
             <el-button type="text" @click="handleFollow(scope.row)"
               >跟进
             </el-button>
@@ -304,6 +305,22 @@ export default {
         ref="addAfterSales"
       ></add-after-sales>
     </el-dialog>
+
+    <el-dialog
+      title="跟进记录"
+      :visible.sync="openOne"
+      v-if="openOne"
+      width="30%"
+      top="100px"
+    >
+      <div v-for="item in 3" :key="item" class="record-item">
+        <div class="head">
+          <span class="time"> 跟进时间:{{}} </span>
+          <span class="name"> 张三 </span>
+        </div>
+        <div class="body">跟进记录</div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -324,4 +341,25 @@ export default {
     overflow-y: auto;
   }
 }
+.record-item {
+  margin-bottom: 20px;
+  .head {
+    margin-bottom: 10px;
+    display: flex;
+    span {
+      font-size: 12px;
+      color: #c3bdbd;
+    }
+    .time {
+      flex: 1;
+    }
+    .name {
+      width: 50px;
+    }
+  }
+  .body {
+    color: #000;
+    font-size: 14px;
+  }
+}
 </style>

+ 14 - 8
src/views/purchase-management/purchase/addPurchase.vue

@@ -74,13 +74,16 @@
                   :inline-message="true"
                   label-width="0"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="scope.row.quantity"
-                    placeholder="请输入"
+                    label="请输入"
+                    style="width: 100%"
                     size="mini"
-                    @change="handleChange"
+                    :controls="false"
+                    :min="1"
+                    :max="9999999"
                   >
-                  </el-input>
+                  </el-input-number>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -93,13 +96,16 @@
                   :inline-message="true"
                   label-width="0"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="scope.row.unitPrice"
-                    placeholder="请输入"
+                    label="请输入"
+                    style="width: 100%"
                     size="mini"
-                    @change="handleChange"
+                    :controls="false"
+                    :min="1"
+                    :max="9999999"
                   >
-                  </el-input>
+                  </el-input-number>
                 </el-form-item>
               </template>
             </el-table-column>

+ 4 - 2
src/views/purchase-management/purchase/index.vue

@@ -141,7 +141,8 @@ export default {
     handlePurchase(row) {
       const data = { ...row };
       // 取出已采购数量
-      const purchaseQuantity = Number(data.purchaseQuantity);
+      const purchaseQuantity =
+        data.purchaseQuantity === -1 ? 0 : Number(data.purchaseQuantity);
       // 默认赋值此次采购数量
       const nowQuantity = Number(data.quantity) - Number(purchaseQuantity);
       const goodsList = [
@@ -174,7 +175,8 @@ export default {
         e.unitPrice = "";
         e.quantityOne = e.quantity;
         // 取出已采购数量
-        let purchaseQuantity = Number(e.purchaseQuantity);
+        let purchaseQuantity =
+          e.purchaseQuantity === -1 ? 0 : Number(e.purchaseQuantity);
         // 默认赋值此次采购数量
         let nowQuantity = Number(e.quantity) - Number(purchaseQuantity);
         e.quantity = nowQuantity;

+ 3 - 1
vue.config.js

@@ -37,7 +37,9 @@ module.exports = {
   // 	entry.add('@/mock').end();
   // },
   css: {
-    extract: { ignoreOrder: true },
+    extract: {
+      ignoreOrder: true
+    },
   },
   //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
   devServer: {