ソースを参照

更改出库流程

yangg 1 年間 前
コミット
47f6d76e03

+ 10 - 0
manager-admin/src/api/basicSetting.js

@@ -403,3 +403,13 @@ export function getUserByDept(params) {
     params
   })
 }
+
+/* 查询客户信息  */
+
+export function getCustomer(id) {
+  return request({
+    url: `/admin/erp/customer/${id}`,
+    method: 'get',
+    loading: false,
+  })
+}

+ 3 - 2
manager-admin/src/api/setting.js

@@ -310,10 +310,11 @@ export function getDetail(id) {
 
 // 获取所有有sn的sku
 
-export function getSnProduct() {
+export function getSnProduct(params) {
   return request({
     url: '/admin/erp/goods/sn/getSnProduct',
-    method: 'get'
+    method: 'get',
+    params
   })
 }
 

+ 27 - 4
manager-admin/src/views/setting/serialList.vue

@@ -142,7 +142,7 @@
       </div>
       <div class="center">
         <el-table
-          :data="snTableData"
+          :data="snTableData.records"
           border
           ref="table"
           style="width: 100%"
@@ -170,6 +170,15 @@
           </el-table-column>
         </el-table>
       </div>
+      <el-pagination
+        @size-change="goodsPageSizeChange"
+        @current-change="goodsPageCurrentChange"
+        :current-page="snTableData.current"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="snTableData.size"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="snTableData.total"
+      ></el-pagination>
       <!-- <el-form :model="stockForm" :rules="stockRules" ref="stockForm" label-width="120px">
         <el-form-item label="商品编码/条码">
           <span>
@@ -297,6 +306,21 @@ export default {
     ...mapGetters(["user"]),
   },
   methods: {
+    /* 分页 */
+    goodsPageSizeChange(size){
+      this.params.page_size = size;
+      API_Setting.getSnProduct(this.params).then((res) => {
+        this.snTableData = res; //this.tableData.data
+      });
+    },
+    goodsPageCurrentChange(page){
+      this.params.page_no = page;
+      API_Setting.getSnProduct(this.params).then((res) => {
+        this.snTableData = res; //this.tableData.data
+    
+      });
+
+    },
     typeName(val) {
       let name = "";
       this.statusList.map((el) => {
@@ -417,9 +441,8 @@ export default {
         admin_id: this.user.uid,
       }; */
       this.title = "新增序列号";
-      API_Setting.getSnProduct().then((res) => {
-        console.log(res);
-        this.snTableData = res.records; //this.tableData.data
+      API_Setting.getSnProduct(this.params).then((res) => {
+        this.snTableData = res; //this.tableData.data
         this.dialogVisible = true;
       });
     },

+ 92 - 228
manager-admin/src/views/stock/goodsExchange/addInventory.vue

@@ -1,107 +1,47 @@
 <template>
   <div class="bg-in-stock">
-    <el-form
-      ref="goodsExchangeAddForm"
-      :model="goodsExchangeAddForm"
-      :rules="goodsExchangeAddFormRule"
-      label-width="160px"
-      inline
-      class="change-form"
-    >
+    <el-form ref="goodsExchangeAddForm" :model="goodsExchangeAddForm" :rules="goodsExchangeAddFormRule"
+      label-width="160px" inline class="change-form">
       <el-form-item label="订单" prop="order_id" class="change-form-item">
         <span>
-          <el-input
-            v-model="goodsExchangeAddForm.sn"
-            :disabled="type === 'detail' || type === 'audit'"
-            ref="order"
-            @keyup.enter.native="blurUsername()"
-          >
+          <el-input v-model="goodsExchangeAddForm.sn" :disabled="type === 'detail' || type === 'audit'" ref="order"
+            @keyup.enter.native="blurUsername()">
           </el-input>
           <el-button @click="blurUsername()">搜索</el-button>
           <el-button @click="orderBtn">订单列表</el-button>
         </span>
       </el-form-item>
-      <el-form-item
-        prop="warehouse_id"
-        label="入库仓库"
-        class="change-form-item"
-      >
-        <el-select
-          v-model="goodsExchangeAddForm.warehouse_id"
-          clearable
-          :disabled="type === 'detail' || type === 'audit'"
-        >
+      <el-form-item prop="warehouse_id" label="入库仓库" class="change-form-item">
+        <el-select v-model="goodsExchangeAddForm.warehouse_id" clearable
+          :disabled="type === 'detail' || type === 'audit'">
           <!--@blur="" @change="handleChangeWareHouse" -->
-          <el-option
-            v-for="item in warehouseList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          />
+          <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
         </el-select>
       </el-form-item>
       <el-form-item label="类型" prop="type" class="change-form-item">
-        <el-select
-          v-model="goodsExchangeAddForm.type"
-          filterable
-          allow-create
-          clearable
-          default-first-option
-          :disabled="type === 'detail' || type === 'audit'"
-        >
-          <el-option
-            v-for="item in typeList"
-            :key="item.id"
-            :label="item.label"
-            :value="item.value"
-            :disabled="item.value == 'TRANSFER_ENTRY'"
-          />
+        <el-select v-model="goodsExchangeAddForm.type" filterable allow-create clearable default-first-option
+          :disabled="type === 'detail' || type === 'audit'">
+          <el-option v-for="item in typeList" :key="item.id" :label="item.label" :value="item.value"
+            :disabled="item.value == 'TRANSFER_ENTRY'" />
         </el-select>
       </el-form-item>
 
-      <el-form-item
-        label="备注"
-        prop="change_desc"
-        class="change-form-item"
-        style="width: 61%"
-      >
-        <el-input
-          style="flex: 1"
-          v-model="goodsExchangeAddForm.memo"
-          type="textarea"
-          :disabled="type === 'detail' || type === 'audit'"
-          :autosize="{ minRows: 3, maxRows: 4 }"
-          placeholder="请输入"
-        ></el-input>
+      <el-form-item label="备注" prop="change_desc" class="change-form-item" style="width: 61%">
+        <el-input style="flex: 1" v-model="goodsExchangeAddForm.memo" type="textarea"
+          :disabled="type === 'detail' || type === 'audit'" :autosize="{ minRows: 3, maxRows: 4 }"
+          placeholder="请输入"></el-input>
       </el-form-item>
       <div class="mx">
         <h3>商品明细</h3>
-        <el-button
-          class="button"
-          size="mini"
-          type="primary"
-          v-if="type !== 'detail' && type !== 'audit'"
-          @click="scanCode"
-          >扫码入库</el-button
-        >
-        <el-button
-          class="button"
-          size="mini"
-          type="primary"
-          v-if="type !== 'detail' && type !== 'audit'"
-          @click="handleSelectWarehouseEntryBatch"
-          >选择</el-button
-        >
+        <el-button class="button" size="mini" type="primary" v-if="type !== 'detail' && type !== 'audit'"
+          @click="scanCode">扫码入库</el-button>
+        <el-button class="button" size="mini" type="primary" v-if="type !== 'detail' && type !== 'audit'"
+          @click="handleSelectWarehouseEntryBatch">选择</el-button>
       </div>
       <div style="width: 100%; display: block">
         <el-form-item style="width: 100%">
-          <el-table
-            :data="goodsExchangeAddForm.product_list"
-            border
-            :cell-style="{ textAlign: 'center' }"
-            :header-cell-style="{ textAlign: 'center' }"
-            style="width: 100%; margin-top: 20px"
-          >
+          <el-table :data="goodsExchangeAddForm.product_list" border :cell-style="{ textAlign: 'center' }"
+            :header-cell-style="{ textAlign: 'center' }" style="width: 100%; margin-top: 20px">
             <el-table-column label="商品编号">
               <template slot-scope="scope">
                 {{ scope.row.goods_vo.sn }}
@@ -121,28 +61,17 @@
             <el-table-column label="序列号">
               <template slot-scope="scope">
                 <div class="sn-code-container">
-                  <span v-for="item in scope.row.sn_code_list" :key="item.id">
-                    {{ item.sn_code }},
-                  </span>
+                  <span v-for="(item, index) in scope.row.sn_code_list" :key="item.id"><span v-if="index !== 0">,</span>{{
+                    item.sn_code }}</span>
                 </div>
-                <!-- <span v-if="id">{{ scope.row.product_vo.sn_code }}</span>
-                <span v-else>{{ scope.row.sn_code }}</span> -->
               </template>
             </el-table-column>
-            <el-table-column
-              prop="product_vo.spec_name"
-              label="规格型号"
-              v-if="id"
-            >
+            <el-table-column prop="product_vo.spec_name" label="规格型号" v-if="id">
               <!-- <template slot-scope="scope">
                 {{ scope.row.product_vo.spec_name }}
               </template> -->
             </el-table-column>
-            <el-table-column
-              prop="product_vo.spec_name"
-              label="规格型号"
-              v-else
-            >
+            <el-table-column prop="product_vo.spec_name" label="规格型号" v-else>
               <!--  <template slot-scope="scope">
                 {{ scope.row.spec_name }}
               </template> -->
@@ -158,13 +87,8 @@
             </el-table-column> -->
             <el-table-column label="入库数量">
               <template slot-scope="scope">
-                <el-input-number
-                  v-model="scope.row.num"
-                  type="number"
-                  :min="0"
-                  :maxlength="20"
-                  :disabled="type === 'detail' || type === 'audit'"
-                ></el-input-number>
+                <el-input-number v-model="scope.row.num" type="number" :min="0" :maxlength="20"
+                  :disabled="type === 'detail' || type === 'audit'"></el-input-number>
               </template>
             </el-table-column>
             <!--  <el-table-column label="库存数量">
@@ -176,28 +100,19 @@
               <template slot-scope="scope">
                 <span v-if="scope.row.orderNum">{{
                   scope.row.num - scope.row.orderNum || 0
-                }}</span>
+                  }}</span>
               </template>
             </el-table-column>
-            <el-table-column
-              width="200"
-              label="操作"
-              v-if="type !== 'detail' && type !== 'audit'"
-            >
+            <el-table-column width="200" label="操作" v-if="type !== 'detail' && type !== 'audit'">
               <template slot-scope="scope">
                 <!-- <el-button
                   size="mini"
                   @click="addSnCode(scope.row, scope.$index)"
                   >添加序列号</el-button
                 > -->
-                <el-button
-                  size="mini"
-                  type="danger"
-                  @click="
-                    goodsExchangeAddForm.product_list.splice(scope.$index, 1)
-                  "
-                  >删除</el-button
-                >
+                <el-button size="mini" type="danger" @click="
+                  goodsExchangeAddForm.product_list.splice(scope.$index, 1)
+                  ">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -209,91 +124,41 @@
       </el-button>
       <el-button v-if="type === 'audit'" type="danger" @click="dialogVisible = true">审核驳回
       </el-button> -->
-      <el-button
-        v-if="type !== 'audit' && type !== 'detail'"
-        type="primary"
-        @click="savegoodsExchangeAddForm"
-        >保存
+      <el-button v-if="type !== 'audit' && type !== 'detail'" type="primary" @click="savegoodsExchangeAddForm">保存
       </el-button>
-      <el-button
-        v-if="type !== 'audit' && type !== 'detail'"
-        type="primary"
-        @click="submitgoodsExchangeAddForm"
-        >入库
+      <el-button v-if="type !== 'audit' && type !== 'detail'" type="primary" @click="submitgoodsExchangeAddForm">入库
       </el-button>
       <el-button @click="printIng" v-if="type == 'audit'">打印</el-button>
       <el-button @click="toBack()">返回</el-button>
     </div>
 
     <el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
-      <el-form
-        ref="goodsExchangeAddForm"
-        :model="goodsExchangeAddForm"
-        label-width="120px"
-        inline
-        style="width: 900px"
-      >
+      <el-form ref="goodsExchangeAddForm" :model="goodsExchangeAddForm" label-width="120px" inline style="width: 900px">
         <el-form-item label="驳回原因" prop="reject_reason">
-          <el-input
-            v-model="goodsExchangeAddForm.reject_reason"
-            type="textarea"
-            :minlength="0"
-            :maxlength="100"
-          ></el-input>
+          <el-input v-model="goodsExchangeAddForm.reject_reason" type="textarea" :minlength="0"
+            :maxlength="100"></el-input>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="handleRejectGoodsExchange()"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="handleRejectGoodsExchange()">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog
-      title="扫码入库"
-      :visible.sync="scanDialogVisible"
-      width="30%"
-      :close-on-click-modal="false"
-    >
-      <el-form
-        ref="scanGoodsForm"
-        :model="scanGoodsForm"
-        label-width="120px"
-        inline
-      >
+    <el-dialog title="扫码入库" :visible.sync="scanDialogVisible" width="30%" :close-on-click-modal="false">
+      <el-form ref="scanGoodsForm" :model="scanGoodsForm" label-width="120px" inline>
         <!-- @blur="blurCode()" -->
         <el-form-item label="条码" prop="bar_code">
-          <el-input
-            v-model="scanGoodsForm.bar_code"
-            ref="input"
-            @keyup.enter.native="toSearch()"
-            :minlength="0"
-            :maxlength="100"
-          ></el-input>
+          <el-input v-model="scanGoodsForm.bar_code" ref="input" @keyup.enter.native="toSearch()" :minlength="0"
+            :maxlength="100"></el-input>
         </el-form-item>
         <el-form-item label="序列号" prop="sn_code">
-          <el-input
-            ref="sn_input"
-            v-model="sn_code"
-            @keyup.enter.native="toSnCode()"
-            :minlength="0"
-            :maxlength="100"
-          ></el-input>
+          <el-input ref="sn_input" v-model="sn_code" @keyup.enter.native="toSnCode()" :minlength="0"
+            :maxlength="100"></el-input>
         </el-form-item>
       </el-form>
     </el-dialog>
-    <el-dialog
-      title="入库商品"
-      :visible.sync="goodsVisible"
-      width="1000px"
-      @close="closeGoosData"
-    >
-      <el-table
-        :data="goodsData"
-        border
-        style="width: 100%"
-        @selection-change="handleSelectionChange"
-      >
+    <el-dialog title="入库商品" :visible.sync="goodsVisible" width="1000px" @close="closeGoosData">
+      <el-table :data="goodsData.records" border style="width: 100%" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" />
         <el-table-column prop="" label="商品编号">
           <template slot-scope="scope">
@@ -316,35 +181,17 @@
         <el-table-column prop="product_vo.unit" label="单位"> </el-table-column>
         <!-- <el-table-column prop="product_list.stock_num" label="库存数量"> </el-table-column> -->
       </el-table>
-      <!-- <el-pagination
-        slot="pagination"
-        @size-change="handlePageSizeChange"
-        @current-change="handlePageCurrentChange"
-        :current-page="goodsData.page_no"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="goodsData.page_size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="goodsData.data_total"
-      >
-      </el-pagination> -->
+      <el-pagination @size-change="goodsPageSizeChange" @current-change="goodsPageCurrentChange"
+        :current-page="goodsData.current" :page-sizes="[10, 20, 50, 100]" :page-size="goodsData.size"
+        layout="total, sizes, prev, pager, next, jumper" :total="goodsData.total">
+      </el-pagination>
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeGoosData">取 消</el-button>
         <el-button type="primary" @click="submitGoosData()">确 定</el-button>
       </span>
     </el-dialog>
-    <el-dialog
-      title="订单列表"
-      :visible.sync="orderVisible"
-      width="1000px"
-      @close="closeGoosData"
-    >
-      <el-table
-        :data="orderList.data"
-        border
-        style="width: 100%"
-        ref="tables"
-        @selection-change="handleSelOrderChange"
-      >
+    <el-dialog title="订单列表" :visible.sync="orderVisible" width="1000px" @close="closeGoosData">
+      <el-table :data="orderList.data" border style="width: 100%" ref="tables" @selection-change="handleSelOrderChange">
         <el-table-column type="selection" width="55" />
         <el-table-column prop="" label="订单编号">
           <template slot-scope="scope">
@@ -360,7 +207,7 @@
         <el-table-column prop="order_time" label="下单时间">
           <template slot-scope="scope">{{
             scope.row.order_time | unixToDate
-          }}</template>
+            }}</template>
         </el-table-column>
         <el-table-column prop="" label="仓库名称">
           <template slot-scope="scope">
@@ -370,7 +217,7 @@
         <el-table-column prop="" label="配送方式">
           <template slot-scope="scope">{{
             deliveryType(scope.row.send_type)
-          }}</template>
+            }}</template>
         </el-table-column>
         <!-- <el-table-column prop="pay_type" label="付款方式">
           <template slot-scope="scope">{{
@@ -380,7 +227,7 @@
         <el-table-column prop="" label="实付金额">
           <template slot-scope="scope">{{
             "¥" + scope.row.pay_price
-          }}</template>
+            }}</template>
         </el-table-column>
         <!-- <el-table-column prop="" label="订单状态">
           <template slot-scope="scope">
@@ -388,15 +235,9 @@
           </template>
         </el-table-column> -->
       </el-table>
-      <el-pagination
-        @size-change="handlePageSizeChange"
-        @current-change="handlePageCurrentChange"
-        :current-page="orderList.page_no"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="orderList.page_size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="orderList.data_total"
-      >
+      <el-pagination @size-change="handlePageSizeChange" @current-change="handlePageCurrentChange"
+        :current-page="orderList.page_no" :page-sizes="[10, 20, 50, 100]" :page-size="orderList.page_size"
+        layout="total, sizes, prev, pager, next, jumper" :total="orderList.data_total">
       </el-pagination>
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeOrder">取 消</el-button>
@@ -703,6 +544,25 @@ export default {
     closeOrder() {
       this.orderVisible = false;
     },
+    goodsPageSizeChange(size) {
+      this.params.page_size = size;
+      API_GoodsExchange.getGoodsInfo(
+        this.params,
+        this.goodsExchangeAddForm.warehouse_id
+      ).then((res) => {
+        this.goodsData = res;
+      });
+    },
+    goodsPageCurrentChange(page) {
+      this.params.page_no = page;
+      API_GoodsExchange.getGoodsInfo(
+        this.params,
+        this.goodsExchangeAddForm.warehouse_id
+      ).then((res) => {
+        this.goodsData = res;
+      });
+
+    },
     /** 分页大小发生改变 */
     handlePageSizeChange(size) {
       this.params.page_size = size;
@@ -888,7 +748,7 @@ export default {
       this.goodsVisible = false;
     },
     // 打印功能
-    printIng() {},
+    printIng() { },
     /* 扫条码 */
     toSearch() {
       API_GoodsExchange.getProduct(
@@ -979,9 +839,9 @@ export default {
                   this.$router.push({ name: "goodsExchange" });
                 });
               })
-              .catch(() => {});
+              .catch(() => { });
           })
-          .catch(() => {});
+          .catch(() => { });
       } else {
         this.$confirm("确定通过吗?", "提示", { type: "warning" })
           .then(() => {
@@ -998,7 +858,7 @@ export default {
               this.$router.push({ name: "goodsExchange" });
             });
           })
-          .catch(() => {});
+          .catch(() => { });
       }
     },
     /** 审核-拒绝 */
@@ -1020,7 +880,7 @@ export default {
             this.$router.push({ name: "goodsExchange" });
           });
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     /** 获取仓库 */
     GET_WarehouseList(e) {
@@ -1232,7 +1092,7 @@ export default {
           item.name = el.goods_vo.name;
           return item;
         });
-        this.goodsData = res.records;
+        this.goodsData = res;
         this.goodsVisible = true;
       });
       /* if (!this.goodsExchangeAddForm.warehouse_id) {
@@ -1366,8 +1226,8 @@ export default {
 </script>
 
 <style type="text/scss" lang="scss" scoped>
-/deep/ {
-}
+/deep/ {}
+
 /** 底部步骤 */
 .footer {
   width: 100%;
@@ -1442,10 +1302,14 @@ export default {
     }
   }
 }
+
 .sn-code-container {
-  max-height: 150px; /* 设置最大高度,超过这个高度将显示滚动条 */
-  overflow-y: auto; /* 垂直方向上溢出时显示滚动条 */
+  max-height: 150px;
+  /* 设置最大高度,超过这个高度将显示滚动条 */
+  overflow-y: auto;
+  /* 垂直方向上溢出时显示滚动条 */
 }
+
 /deep/ {
   .el-input--suffix .el-input__inner {
     padding-right: 10px;

+ 4 - 5
manager-admin/src/views/stock/goodsExchange/goodsExchangeAdd.vue

@@ -173,8 +173,8 @@
             </el-table-column>
             <el-table-column label="序列号" v-if="sn_code_list">
               <template slot-scope="scope">
-                <span v-for="item in scope.row.sn_code_list" :key="item.id">{{item.sn_code}},</span>
-              </template>
+                    <span v-for="(item,index) in scope.row.sn_code_list" :key="item.id"><span v-if="index!==0">,</span>{{ item.sn_code }}</span>
+                  </template>
             </el-table-column>
             <el-table-column
               prop="product_vo.spec_name"
@@ -292,7 +292,7 @@
         >
       </span>
     </el-dialog>
-    <el-dialog title="扫码出库" :visible.sync="scanDialogVisible" width="30%">
+    <el-dialog title="扫码出库" :visible.sync="scanDialogVisible" width="30%" :close-on-click-modal="false">
       <el-form
         ref="scanGoodsForm"
         :model="scanGoodsForm"
@@ -566,7 +566,6 @@ export default {
           this.$refs.input.focus();
         });
       });
-
     },
     addSnCode(row, index) {
       this.sku = row.product_vo.sku;
@@ -648,7 +647,7 @@ export default {
         }
       });
     },
-    // 扫码
+    // 扫码
     scanCode() {
       if (!this.goodsExchangeAddForm.warehouse_id) {
         this.$message.error("请先选择仓库!");

+ 3 - 1
manager-admin/src/views/stock/order.vue

@@ -502,7 +502,9 @@ export default {
           page_size: response.page_size,
           data_total: response.data_total,
         };
-      });
+      }).catch(() => { 
+        this.loading = false;
+      })
     },
   },
 };

+ 103 - 67
manager-admin/src/views/stock/orderAdd.vue

@@ -8,29 +8,39 @@
       <h3>基本信息</h3>
       <el-row>
         <el-col :span="10">
-          <el-form-item label="订单类型" prop="type" :rules="rules.type">
+          <el-form-item label="订单类型:" prop="type" :rules="rules.type">
             <el-select v-model="OrderForm.type" clearable :disabled="type == 'pone'">
               <el-option v-for="(item, index) in orderTypeList" :key="index" :label="item.label" :value="item.value" />
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="10">
-          <el-form-item label="下单客户" prop="member_id" :rules="rules.member_id">
-            <el-select v-model="OrderForm.member_id" clearable :disabled="type == 'pone'">
+          <el-form-item label="下单客户:" prop="member_id">
+            <el-select v-model="OrderForm.member_id" clearable :disabled="type == 'pone'" @change="selMember">
               <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
-            <el-button type="primary" v-if="type !== 'pone'" @click="addCust">新增客户</el-button>
+            <!--   <el-button type="primary" v-if="type !== 'pone'" @click="addCust">新增客户</el-button> -->
           </el-form-item>
         </el-col>
         <el-col :span="10">
-          <el-form-item label="起始时间" prop="time" :rules="rules.start_time" v-if="OrderForm.type == 'TO_C'">
+          <el-form-item label="客户名称:" prop="customer_name">
+            <el-input placeholder="请输入客户名称" v-model="OrderForm.customer_name" :disabled="type == 'pone'"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="10">
+          <el-form-item label="客户联系方式:" prop="customer_phone">
+            <el-input placeholder="请输入客户联系方式" v-model="OrderForm.customer_phone" :disabled="type == 'pone'"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="10">
+          <el-form-item label="起始时间:" prop="time" :rules="rules.start_time" v-if="OrderForm.type == 'TO_C'">
             <el-date-picker v-model="OrderForm.start_time" type="datetime" placeholder="选择日期时间"
               :disabled="type == 'pone'" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss">
             </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col :span="10">
-          <el-form-item label="付款方式" prop="pay_type" :rules="rules.pay_type">
+          <el-form-item label="付款方式:" prop="pay_type" :rules="rules.pay_type">
             <el-select v-model="OrderForm.pay_type" clearable :disabled="type == 'pone'">
               <el-option v-for="item in collectingAccountList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
@@ -56,21 +66,21 @@
           </el-form-item>
         </el-col>
         <el-col :span="10">
-          <el-form-item label="销售人员" prop="marketing_id" :rules="rules.marketing_id">
+          <el-form-item label="销售人员:" prop="marketing_id" :rules="rules.marketing_id">
             <el-select v-model="OrderForm.marketing_id" clearable :disabled="type == 'pone'">
               <el-option v-for="item in marketingList" :key="item.id" :label="item.real_name" :value="item.id" />
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="10">
-          <el-form-item label="配送方式" prop="send_type" :rules="rules.send_type">
+          <el-form-item label="配送方式:" prop="send_type" :rules="rules.send_type">
             <el-select v-model="OrderForm.send_type" clearable :disabled="type == 'pone'">
               <el-option v-for="item in deliveryTypeList" :key="item.code" :label="item.name" :value="item.code" />
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="10">
-          <el-form-item label="配送仓库" prop="warehouse_id" :rules="rules.warehouse_id">
+          <el-form-item label="配送仓库:" prop="warehouse_id" :rules="rules.warehouse_id">
             <!-- <el-cascader v-model="OrderForm.dept_id" :options="deptList" :props="{
             label: 'name',
             value: 'id',
@@ -84,15 +94,15 @@
           </el-form-item>
         </el-col>
         <el-col :span="10">
-          <el-form-item label="配送地址" prop="province_city_area_address">
-            <el-cascader size="large" :options="options" clearable v-model="selectedOptions" @change="handleChange"
+          <el-form-item label="配送地址:" prop="province_city_area_address">
+            <el-cascader size="small" :options="options" clearable v-model="selectedOptions" @change="handleChange"
               :disabled="type == 'pone'">
             </el-cascader>
             <el-input v-model="OrderForm.address" placeholder="请输入" :disabled="type == 'pone'"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="10">
-          <el-form-item label="允许负库存">
+          <el-form-item label="允许负库存:">
             <el-radio-group v-model="OrderForm.subtract_stock" :disabled="type == 'pone'">
               <el-radio :label="false">禁止</el-radio>
               <el-radio :label="true">允许</el-radio>
@@ -101,7 +111,7 @@
         </el-col>
         <el-col :span="24">
           <div class="redClass">
-            <el-form-item label="备注" prop="remark">
+            <el-form-item label="备注:" prop="remark">
               <el-input v-model="OrderForm.remark" type="textarea" :autosize="{ minRows: 2 }"
                 :disabled="type == 'pone'"></el-input>
             </el-form-item>
@@ -392,6 +402,7 @@ const initOrderForm = {
   subtract_stock: false,
   payment_status: "NOT_PAY",
   start_time: null,
+  real_price: 0
 };
 
 export default {
@@ -429,6 +440,8 @@ export default {
         subtract_stock: false,
         warehouse_id: [],
         start_time: null,
+        customer_name: "",
+        customer_phone: '',
       },
       formLoading: false,
       isDetail: undefined,
@@ -441,13 +454,14 @@ export default {
       batchTaxRate: 0, // 批量设置的税率
       showTaxRate: false, // 是否显示税率设置
       rules: {
+        customer_name: [this.MixinRequired("请输入客户名称", "blur")],
         type: [this.MixinRequired("请选择订单类型", "change")],
         pay_type: [this.MixinRequired("请选择付款方式", "change")],
         pay_price: [this.MixinRequired("请输入付款金额", "blur")],
         marketing_id: [this.MixinRequired("请选择销售人员", "change")],
         send_type: [this.MixinRequired("请选择配送方式", "change")],
         warehouse_id: [this.MixinRequired("请选择仓库", "change")],
-        member_id: [this.MixinRequired("请选择下单客户", "change")],
+        //member_id: [this.MixinRequired("请选择下单客户", "change")],
         order_time: [this.MixinRequired("下单时间不能为空", "change")],
         payment_status: [this.MixinRequired("支付状态不能为空", "change")],
         payment_time: [this.MixinRequired("支付时间不能为空", "change")],
@@ -534,6 +548,19 @@ export default {
             },
           ],
         },
+        customer_phone: [
+          this.MixinRequired("请输入手机号码!"),
+          {
+            validator: (rule, value, callback) => {
+              if (!RegExp.mobile.test(value)) {
+                callback(new Error("手机号码格式有误!"));
+              } else {
+                callback();
+              }
+            },
+            trigger: ["change", "blur"],
+          },
+        ],
       },
       deptList: [],
       // 客户列表
@@ -642,6 +669,17 @@ export default {
     this.GET_CustomerList();
   },
   methods: {
+    selMember(val) {
+      API_BasicSetting.getCustomer(val).then(res => {
+
+        this.$set(this.OrderForm, 'customer_name', res.name);
+        this.$set(this.OrderForm, 'customer_phone', res.mobile);
+        /*  this.$nextTick(() => { this.OrderForm.customer_name = res.name
+          this.OrderForm.customer_phone = res.mobile
+        }) */
+      })
+
+    },
     //选择商品
     handleSelChange(val) {
       if (val.length > 1) {
@@ -682,7 +720,6 @@ export default {
        // 使用正则表达式来检查输入是否为1到10的整数或最多两位小数
        const value = event.target.value;
        const regex = /^(10|([1-9](\.\d{0,1})?))$/;
-       console.log(regex.test(value) || value === '');
        if (regex.test(value) || value === '') {
          this.discount = value;
        } else {
@@ -808,7 +845,6 @@ export default {
       API_BasicSetting.customer(this.params)
         .then((response) => {
           this.customerList = response.data;
-          console.log(this.customerList);
         })
         .catch(() => { });
       API_Setting.getPage({ dictType: "order_type" }).then((res) => {
@@ -877,7 +913,6 @@ export default {
         return;
       }
       let warehouse_ids = this.OrderForm.warehouse_id.join(',')
-      console.log(this.OrderForm.warehouse_id);
       const goodsData = await this.$EnPickerGoods({
         goodsApi: `/admin/erp/warehouseOut/getGoodByWarehouse/warehouseIdAndOrderType/${this.OrderForm.type}/${warehouse_ids}`,
         // goodsApi: `/admin/erp/warehouseOut/getGoodByWarehouse/warehouseIdAndOrderType`,
@@ -1031,11 +1066,7 @@ export default {
       }
       this.OrderForm.province_city_area_address = loc + this.OrderForm.address;
       const params = this.MixinClone(this.OrderForm);
-      params.product_list = params.product_list.map((el) => {
-        el.product_stock_id = el.id;
-        el.id = "";
-        return el;
-      });
+
       /*  params.item_list = params.product_list;
       params.product_list.map((el) => {
         el.goods_id = el.id;
@@ -1060,6 +1091,11 @@ export default {
             this.formLoading = false;
           });
       } else {
+        params.product_list = params.product_list.map((el) => {
+          el.product_stock_id = el.id;
+          el.id = "";
+          return el;
+        });
         API_Order.addOrder(params)
           .then(() => {
             this.$message.success("添加成功!");
@@ -1095,11 +1131,7 @@ export default {
       }
       this.OrderForm.province_city_area_address = loc + this.OrderForm.address;
       const params = this.MixinClone(this.OrderForm);
-      params.product_list = params.product_list.map((el) => {
-        el.product_stock_id = el.id;
-        el.id = "";
-        return el;
-      });
+
       params.pay_price = this.price;
       params.real_price = Number(params.real_price);
       params.item_list = params.product_list;
@@ -1123,14 +1155,18 @@ export default {
             this.formLoading = false;
           });
       } else {
+        params.product_list = params.product_list.map((el) => {
+          el.product_stock_id = el.id;
+          el.id = "";
+          return el;
+        });
         API_Order.addOrder(params)
           .then((res) => {
             this.$message.success("添加成功!");
-            console.log(res);
             /**/ API_Order.submit(res).then((res) => {
               this.$message.success("订单已确认");
+              this.backOrderList();
             });
-            this.backOrderList();
           })
           .finally(() => {
             this.formLoading = false;
@@ -1210,7 +1246,6 @@ export default {
         });
         this.selectedOptions = response.province_city_area.split(",");
         this.OrderForm = response;
-        console.log(this.OrderForm.product_list);
         /* this.fileList = response.attachment
           ? [{ name: "附件", url: response.attachment }]
           : [];
@@ -1270,42 +1305,43 @@ export default {
         }
       },
       set(newValue) {
-        let total = 0;
-        if (!this.OrderForm.product_list) return
-        if (!this.id) {
-          if (this.OrderForm.type == "TO_C") {
-            var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
-            this.OrderForm.product_list.map((item) => {
-              var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
-              var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
-              var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
-              total += item.product_vo.day_price * item.num * monthDiff;
-            });
-
-            return total;
-          } else {
-            this.OrderForm.product_list.map((item) => {
-              total += item.product_vo.price * item.num;
-            });
-            return total;
-          }
-        } else {
-          if (this.OrderForm.type == "TO_C") {
-            var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
-            var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
-            var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
-            var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
-            this.OrderForm.product_list.map((item) => {
-              total += item.product_vo.day_price * item.num * monthDiff;
-            });
-            return total;
-          } else {
-            this.OrderForm.product_list.map((item) => {
-              total += item.product_vo.price * item.num;
-            });
-            return total;
-          }
-        }
+        this.OrderForm.real_price = newValue;
+        /*  let total = 0;
+         if (!this.OrderForm.product_list) return
+         if (!this.id) {
+           if (this.OrderForm.type == "TO_C") {
+             var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
+             this.OrderForm.product_list.map((item) => {
+               var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
+               var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
+               var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
+               total += item.product_vo.day_price * item.num * monthDiff;
+             });
+ 
+             return total;
+           } else {
+             this.OrderForm.product_list.map((item) => {
+               total += item.product_vo.price * item.num;
+             });
+             return total;
+           }
+         } else {
+           if (this.OrderForm.type == "TO_C") {
+             var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
+             var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
+             var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
+             var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
+             this.OrderForm.product_list.map((item) => {
+               total += item.product_vo.day_price * item.num * monthDiff;
+             });
+             return total;
+           } else {
+             this.OrderForm.product_list.map((item) => {
+               total += item.product_vo.price * item.num;
+             });
+             return total;
+           }
+         } */
       }
     },
   },
@@ -1321,7 +1357,7 @@ export default {
       handler(newVal) {
         newVal.forEach((item) => {
           /* item.sum=item.price*item.num
-          return console.log(item.sum+=); */
+          return  */
         });
         /* this.OrderForm.total_price = newVal.reduce(
           (sum, item) => sum + item.total_price,

+ 318 - 261
manager-admin/src/views/stock/orderOutbound.vue

@@ -2,41 +2,20 @@
   <div>
     <div class="bg-in">
       <div>
-        <el-form
-          :model="deliveryForms"
-          :rules="rules"
-          ref="ruleForm"
-          label-width="120px"
-        >
+        <el-form :model="deliveryForms" :rules="rules" ref="ruleForm" label-width="120px">
           <el-row>
             <el-col>
               <el-form-item label="预约类型:" prop="appointment_type">
-                <el-select
-                  v-model="deliveryForms.appointment_type"
-                  :disabled="disabledType"
-                >
-                  <el-option
-                    v-for="(item, index) in appointmentList"
-                    :key="index"
-                    :label="item.label"
-                    :value="item.value"
-                  ></el-option>
+                <el-select v-model="deliveryForms.appointment_type" :disabled="disabledType">
+                  <el-option v-for="(item, index) in appointmentList" :key="index" :label="item.label"
+                    :value="item.value"></el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col>
-              <el-form-item
-                label="预约时间:"
-                prop=""
-                v-if="deliveryForms.appointment_type != 0"
-              >
-                <el-date-picker
-                  v-model="deliveryForms.appointment_time"
-                  type="datetime"
-                  placeholder="选择日期时间"
-                  :disabled="disabledType"
-                  value-format="yyyy-MM-dd HH:mm:ss"
-                ></el-date-picker>
+              <el-form-item label="预约时间:" prop="" v-if="deliveryForms.appointment_type != 0">
+                <el-date-picker v-model="deliveryForms.appointment_time" type="datetime" placeholder="选择日期时间"
+                  :disabled="disabledType" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
               </el-form-item>
             </el-col>
           </el-row>
@@ -45,43 +24,21 @@
           <el-row>
             <el-col :span="12">
               <el-form-item label="发货人姓名:" prop="sender.name">
-                <!-- <el-select v-model="deliveryForms.sender.name"> </el-select> -->
-                <el-input
-                  v-model="deliveryForms.sender.name"
-                  :minlength="1"
-                  :maxlength="20"
-                  placeholder="请输入发货人姓名"
-                  :disabled="disabledType"
-                ></el-input>
+                <el-input v-model="deliveryForms.sender.name" :minlength="1" :maxlength="20" placeholder="请输入发货人姓名"
+                  :disabled="true"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="手机号:" prop="sender.phone">
-                <el-input
-                  v-model="deliveryForms.sender.phone"
-                  :minlength="1"
-                  :maxlength="20"
-                  :disabled="disabledType"
-                  placeholder="请输入手机号"
-                ></el-input> </el-form-item
-            ></el-col>
+                <el-input v-model="deliveryForms.sender.phone" :minlength="1" :maxlength="20" :disabled="true"
+                  placeholder="请输入手机号"></el-input> </el-form-item></el-col>
             <el-col :span="12">
               <el-form-item label="发货地址:" prop="sender.address">
-                <el-cascader
-                  size="large"
-                  :options="options"
-                  clearable
-                  :disabled="disabledType"
-                  v-model="selectedOptions"
-                  @change="sendHandleChange"
-                >
+                <el-cascader size="large" :options="options" clearable :disabled="true" v-model="selectedOptions"
+                  @change="sendHandleChange">
                 </el-cascader>
-                <el-input
-                  :disabled="disabledType"
-                  v-model="deliveryForms.sender.address"
-                  placeholder="请输入"
-                ></el-input> </el-form-item
-            ></el-col>
+                <el-input :disabled="true" v-model="deliveryForms.sender.address" placeholder="请输入"></el-input>
+              </el-form-item></el-col>
             <!--    <el-col :span="12">
               <el-form-item label="配送仓库:" prop="freight_price">
                 <el-select>
@@ -112,43 +69,21 @@
           <!-- --><el-row>
             <el-col :span="12">
               <el-form-item label="收货人姓名:" prop="receiver.name">
-                <el-input
-                  v-model="deliveryForms.receiver.name"
-                  :minlength="1"
-                  :maxlength="20"
-                  :disabled="disabledType"
-                  placeholder="请输入收货人姓名"
-                ></el-input>
+                <el-input v-model="deliveryForms.receiver.name" :minlength="1" :maxlength="20" :disabled="true"
+                  placeholder="请输入收货人姓名"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="手机号:" prop="receiver.phone">
-                <el-input
-                  v-model="deliveryForms.receiver.phone"
-                  :minlength="1"
-                  :maxlength="20"
-                  :disabled="disabledType"
-                  placeholder="请输入手机号"
-                ></el-input> </el-form-item
-            ></el-col>
+                <el-input v-model="deliveryForms.receiver.phone" :minlength="1" :maxlength="20" :disabled="true"
+                  placeholder="请输入手机号"></el-input> </el-form-item></el-col>
             <el-col :span="12">
               <el-form-item label="配送地址:" prop="receiver.address">
-                <el-cascader
-                  size="large"
-                  :options="options"
-                  clearable
-                  :disabled="disabledType"
-                  v-model="receiverOptions"
-                  @change="receiverChange"
-                >
+                <el-cascader size="large" :options="options" clearable :disabled="true" v-model="receiverOptions"
+                  @change="receiverChange">
                 </el-cascader>
-                <el-input
-                  v-model="deliveryForms.receiver.address"
-                  size="medium"
-                  :disabled="disabledType"
-                  placeholder="请输入"
-                ></el-input> </el-form-item
-            ></el-col>
+                <el-input v-model="deliveryForms.receiver.address" size="medium" :disabled="true"
+                  placeholder="请输入"></el-input> </el-form-item></el-col>
           </el-row>
           <el-divider></el-divider>
           <!--  <el-row  :gutter="20">
@@ -166,13 +101,8 @@
             ></el-col>
           </el-row> -->
           <h3>商品信息:</h3>
-          <el-table
-            :data="product_list"
-            border
-            :cell-style="{ textAlign: 'center' }"
-            :header-cell-style="{ textAlign: 'center' }"
-            style="width: 95%"
-          >
+          <el-table :data="product_list" border :cell-style="{ textAlign: 'center' }"
+            :header-cell-style="{ textAlign: 'center' }" style="width: 95%">
             <el-table-column type="selection" width="40" align="center" />
             <el-table-column label="商品编号">
               <template slot-scope="scope">
@@ -189,14 +119,15 @@
                 {{ scope.row.product_vo.bar_code }}
               </template>
             </el-table-column>
-            <el-table-column label="序列号">
+            <el-table-column label="序列号" v-if="sn_code_list">
               <template slot-scope="scope">
-                {{ scope.row.product_vo.sn_code }}
+                <span v-for="(item, index) in scope.row.sn_code_list" :key="item.id"><span v-if="index !== 0">,</span>{{
+                  item.sn_code }}</span>
               </template>
             </el-table-column>
             <el-table-column label="规格型号">
               <template slot-scope="scope">
-                {{ scope.row.product_vo.spec_name}}
+                {{ scope.row.product_vo.spec_name }}
               </template>
             </el-table-column>
             <el-table-column label="单位">
@@ -216,60 +147,96 @@
             </el-table-column>
           </el-table>
           <el-divider></el-divider>
-          <h3></h3>
+          <h3>出库明细</h3>
+          <el-button class="button" size="mini" type="primary" @click="scanCode"
+            :disabled="disabledType">扫码出库</el-button>
+          <div style="width: 100%; display: block">
+            <!--    //  -->
+            <el-form-item style="width: 100%">
+              <el-table border :data="goodsExchangeAddForm.product_list" :cell-style="{ textAlign: 'center' }"
+                :header-cell-style="{ textAlign: 'center' }" style="width: 100%; margin-top: 20px">
+                <el-table-column label="商品编号">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.goods_vo.sn }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="商品名称">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.goods_vo.name }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="条码">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.product_vo.bar_code }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="序列号" v-if="sn_code_list">
+                  <template slot-scope="scope">
+                    <span v-for="(item, index) in scope.row.sn_code_list" :key="item.id"><span
+                        v-if="index !== 0">,</span>{{ item.sn_code }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="product_vo.spec_name" label="规格型号">
+                </el-table-column>
+                <el-table-column label="单位">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.product_vo.unit }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="出库数量">
+                  <template slot-scope="scope">
+                    {{ scope.row.num }}
+                    <!--  <el-input v-model="scope.row.out_num" type="number" :min="0" :maxlength="20"></el-input> -->
+                  </template>
+                </el-table-column>
+                <el-table-column label="库存数量">
+                  <template slot-scope="scope">
+                    <span v-if="!disabledType">{{ scope.row.usable_stock }}</span>
+                    <span v-else>{{ scope.row.use_able_stock }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column width="200" label="操作" v-if="!disabledType">
+                  <template slot-scope="scope">
+                    <!-- <el-button
+                  size="mini"
+                  @click="addSnCode(scope.row,scope.$index)"
+                  >添加序列号</el-button
+                > -->
+                    <el-button size="mini" @click="
+                      goodsExchangeAddForm.product_list.splice(scope.$index, 1)
+                      ">删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-form-item>
+          </div>
 
+          <el-divider></el-divider>
+          <h3></h3>
           <el-row>
             <el-col :span="8">
               <el-form-item label="物品总重量:" prop="total_weight">
-                <el-input
-                  v-model.number="deliveryForms.total_weight"
-                  :minlength="1"
-                  :maxlength="20"
-                  type="number"
-                  max="50"
-                  clearable
-                  :disabled="disabledType"
-                  placeholder="请输入物品总重量"
-                  ><template slot="append">KG</template></el-input
-                >
+                <el-input v-model.number="deliveryForms.total_weight" :minlength="1" :maxlength="20" type="number"
+                  max="50" clearable :disabled="disabledType" placeholder="请输入物品总重量"><template
+                    slot="append">KG</template></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="物品总体积:" prop="total_volume">
-                <el-input
-                  v-model="deliveryForms.total_volume"
-                  :minlength="1"
-                  :maxlength="20"
-                  clearable
-                  :disabled="disabledType"
-                  placeholder="请输入物品总体积"
-                  ><template slot="append">m³</template></el-input
-                >
+                <el-input v-model="deliveryForms.total_volume" :minlength="1" :maxlength="20" clearable
+                  :disabled="disabledType" placeholder="请输入物品总体积"><template slot="append">m³</template></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="物品价格:" prop="declared_value">
-                <el-input
-                  v-model="deliveryForms.declared_value"
-                  :minlength="1"
-                  :maxlength="20"
-                  clearable
-                  :disabled="disabledType"
-                  placeholder="请输入物品价格"
-                  ><template slot="append">元</template></el-input
-                >
+                <el-input v-model="deliveryForms.declared_value" :minlength="1" :maxlength="20" clearable
+                  :disabled="disabledType" placeholder="请输入物品价格"><template slot="append">元</template></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="16">
               <el-form-item label="备注:" prop="remark">
-                <el-input
-                  v-model="deliveryForms.remark"
-                  type="textarea"
-                  clearable
-                  :disabled="disabledType"
-                  :autosize="{ minRows: 2, maxRows: 4 }"
-                  placeholder="请输入备注"
-                ></el-input>
+                <el-input v-model="deliveryForms.remark" type="textarea" clearable :disabled="disabledType"
+                  :autosize="{ minRows: 2, maxRows: 4 }" placeholder="请输入备注"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -277,45 +244,26 @@
           <el-row :gutter="20">
             <el-col :span="8" :offset="6">
               <el-form-item label="物流单号:" prop="tracking_number">
-                <el-input
-                  v-model="kdnCode"
-                  :minlength="1"
-                  :maxlength="20"
-                  :disabled="true"
-                  placeholder="请输入物流单号"
-                ></el-input>
-                <el-button
-                  @click="obtainOrder"
-                  v-if="kdnCode == '' || kdnCode == undefined"
-                  :disabled="btnType"
-                  >获取单号</el-button
-                >
-              </el-form-item></el-col
-            >
+                <el-input v-model="kdnCode" :minlength="1" :maxlength="20" :disabled="true"
+                  placeholder="请输入物流单号"></el-input>
+                <el-button @click="obtainOrder" v-if="kdnCode == '' || kdnCode == undefined"
+                  :disabled="btnType">获取单号</el-button>
+              </el-form-item></el-col>
           </el-row>
         </el-form>
       </div>
-      <div
-        v-if="
-          outType !== undefined &&
-          (JSON.stringify(deliveryForms.create_order_fail) !== '{}' ||
-            JSON.stringify(deliveryForms.create_order_success) !== '{}')
-        "
-      >
+      <div v-if="
+        outType !== undefined &&
+        (JSON.stringify(deliveryForms.create_order_fail) !== '{}' ||
+          JSON.stringify(deliveryForms.create_order_success) !== '{}')
+      ">
         <h3>物流状态:</h3>
-        <div
-          class="steps-wrap"
-          v-if="JSON.stringify(deliveryForms.create_order_fail) !== '{}'"
-        >
+        <div class="steps-wrap" v-if="JSON.stringify(deliveryForms.create_order_fail) !== '{}'">
           <el-steps class="steps" direction="vertical" process-status="finish">
-            <el-step
-              icon="el-icon-error"
-              :title="
-                deliveryForms.create_order_fail && deliveryForms.create_order_fail.orderStatus  == 600
-                  ? '下单失败'
-                  : ''
-              "
-            >
+            <el-step icon="el-icon-error" :title="deliveryForms.create_order_fail && deliveryForms.create_order_fail.orderStatus == 600
+              ? '下单失败'
+              : ''
+              ">
               <div slot="description">
                 <p class="row-remark">
                   {{ safeAccess(deliveryForms.create_order_fail, 'remark') }}
@@ -333,17 +281,10 @@
           </el-steps>
         </div>
         <div class="steps-wrap" v-else>
-          <el-steps
-            class="steps"
-            direction="vertical"
-            process-status="finish"
-            :active="activeStep"
-          >
-            <el-step
-              icon="el-icon-success"
-              v-if="JSON.stringify(deliveryForms.sign_in) !== '{}'&&deliveryForms.sign_in.orderStatus == 402"
-              :title="deliveryForms.sign_in.orderStatus == 402 ? '退回' : ''"
-            >
+          <el-steps class="steps" direction="vertical" process-status="finish" :active="activeStep">
+            <el-step icon="el-icon-success"
+              v-if="JSON.stringify(deliveryForms.sign_in) !== '{}' && deliveryForms.sign_in.orderStatus == 402"
+              :title="deliveryForms.sign_in.orderStatus == 402 ? '退回' : ''">
               <div slot="description">
                 <p class="row-remark">
                   订单号:{{ deliveryForms.create_order_success.orderCode }}
@@ -357,11 +298,8 @@
                 </p>
               </div>
             </el-step>
-            <el-step
-              icon="el-icon-success"
-              v-if="JSON.stringify(deliveryForms.sign_in) !== '{}'"
-              :title="deliveryForms.sign_in.orderStatus == 401 ? '签收' : ''"
-            >
+            <el-step icon="el-icon-success" v-if="JSON.stringify(deliveryForms.sign_in) !== '{}'"
+              :title="deliveryForms.sign_in.orderStatus == 401 ? '签收' : ''">
               <div slot="description">
                 <p class="row-remark">
                   订单号:{{ deliveryForms.create_order_success.orderCode }}
@@ -375,13 +313,8 @@
                 </p>
               </div>
             </el-step>
-            <el-step
-              icon="el-icon-success"
-              v-if="JSON.stringify(deliveryForms.user_sending) !== '{}'"
-              :title="
-                deliveryForms.user_sending.orderStatus == 300 ? '配送中' : ''
-              "
-            >
+            <el-step icon="el-icon-success" v-if="JSON.stringify(deliveryForms.user_sending) !== '{}'" :title="deliveryForms.user_sending.orderStatus == 300 ? '配送中' : ''
+              ">
               <div slot="description">
                 <p class="row-remark">
                   订单号:{{ deliveryForms.create_order_success.orderCode }}
@@ -399,13 +332,8 @@
                 </p>
               </div>
             </el-step>
-            <el-step
-              icon="el-icon-success"
-              v-if="JSON.stringify(deliveryForms.user_arrives) !== '{}'"
-              :title="
-                deliveryForms.user_arrives.orderStatus == 202 ? '已取件' : ''
-              "
-            >
+            <el-step icon="el-icon-success" v-if="JSON.stringify(deliveryForms.user_arrives) !== '{}'" :title="deliveryForms.user_arrives.orderStatus == 202 ? '已取件' : ''
+              ">
               <div slot="description">
                 <p class="row-remark">
                   订单号:{{ deliveryForms.create_order_success.orderCode }}
@@ -423,13 +351,8 @@
                 </p>
               </div>
             </el-step>
-            <el-step
-              icon="el-icon-success"
-              v-if="JSON.stringify(deliveryForms.user_take_order) !== '{}'"
-              :title="
-                deliveryForms.user_take_order.orderStatus == 201 ? '已接单' : ''
-              "
-            >
+            <el-step icon="el-icon-success" v-if="JSON.stringify(deliveryForms.user_take_order) !== '{}'" :title="deliveryForms.user_take_order.orderStatus == 201 ? '已接单' : ''
+              ">
               <div slot="description">
                 <p class="row-remark">
                   订单号:{{ deliveryForms.create_order_success.orderCode }}
@@ -443,20 +366,15 @@
                 <p class="row-time">
                   {{
                     (deliveryForms.user_take_order.requestTime / 1000)
-                      | unixToDate
+                    | unixToDate
                   }}
                 </p>
               </div>
             </el-step>
-            <el-step
-              icon="el-icon-success"
-              v-if="JSON.stringify(deliveryForms.create_order_success) !== '{}'"
-              :title="
-                deliveryForms.create_order_success.orderStatus == 100
-                  ? '待接单'
-                  : ''
-              "
-            >
+            <el-step icon="el-icon-success" v-if="JSON.stringify(deliveryForms.create_order_success) !== '{}'" :title="deliveryForms.create_order_success.orderStatus == 100
+              ? '待接单'
+              : ''
+              ">
               <div slot="description">
                 <p class="row-remark">
                   订单号:{{ deliveryForms.create_order_success.orderCode }}
@@ -470,7 +388,7 @@
                 <p class="row-time">
                   {{
                     (deliveryForms.create_order_success.requestTime / 1000)
-                      | unixToDate
+                    | unixToDate
                   }}
                 </p>
               </div>
@@ -478,6 +396,22 @@
           </el-steps>
         </div>
       </div>
+      <el-dialog title="扫码出库" :visible.sync="scanDialogVisible" width="30%" :close-on-click-modal="false">
+        <el-form ref="scanGoodsForm" :model="scanGoodsForm" inline>
+          <el-form-item label="条码" prop="bar_code">
+            <el-input v-model="scanGoodsForm.bar_code" ref="input" @keyup.enter.native="toSearch()" :minlength="0"
+              :maxlength="100"></el-input>
+          </el-form-item>
+          <el-form-item label="序列号" prop="sn_code">
+            <el-input v-model="sn_code" ref="sn_input" @keyup.enter.native="toSnCode()" :minlength="0"
+              :maxlength="100"></el-input>
+          </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <!-- <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="handleRejectGoodsExchange()">确 定</el-button> -->
+        </span>
+      </el-dialog>
       <!--  <el-divider></el-divider>
       <el-form
         :model="deliveryForms"
@@ -550,12 +484,7 @@
       </el-form> -->
       <div class="footer">
         <!-- <el-button type="primary"> 获取全部单号 </el-button> -->
-        <el-button
-          type="primary"
-          @click="saveErpWarehouseOut"
-          :disabled="outType == 'check'"
-          v-if="kdnCode !== ''"
-          >发货
+        <el-button type="primary" @click="saveErpWarehouseOut" :disabled="outType == 'check'" v-if="kdnCode !== ''">发货
         </el-button>
         <el-button @click="roBack2()">返回</el-button>
       </div>
@@ -568,6 +497,7 @@ import * as API_order from "@/api/order";
 import * as API_Setting from "@/api/setting";
 import * as API_Auth from "@/api/auth";
 import { RegExp } from "~/ui-utils";
+import * as API_GoodsExchange from "@/api/goodsExchange";
 import { Foundation } from "~/ui-utils";
 import {
   provinceAndCityData,
@@ -694,6 +624,16 @@ export default {
       receive_address: "",
       detailData: [], // 物流详情
       /* nameToCodeMap:{} */
+      sn_code: "",
+      sku: "",
+      sn_code_list: [],
+      index: "",
+      scanDialogVisible: false,
+      goodsExchangeAddForm: {
+        product_list: [],
+        type: "",
+      },
+      scanGoodsForm: {},
     };
   },
   watch: {
@@ -713,24 +653,24 @@ export default {
   computed: {
     ...mapGetters(["user"]),
     activeStep() {
-    // 定义步骤数组,每个元素对应一个步骤的条件
-    const steps = [
-      this.deliveryForms.sign_in && this.deliveryForms.sign_in.orderStatus === 402,
-      this.deliveryForms.sign_in && this.deliveryForms.sign_in.orderStatus === 401,
-      this.deliveryForms.user_sending && this.deliveryForms.user_sending.orderStatus === 300,
-      this.deliveryForms.user_arrives && this.deliveryForms.user_arrives.orderStatus === 202,
-      this.deliveryForms.user_take_order && this.deliveryForms.user_take_order.orderStatus === 201,
-      this.deliveryForms.create_order_success && this.deliveryForms.create_order_success.orderStatus === 100
-    ];
+      // 定义步骤数组,每个元素对应一个步骤的条件
+      const steps = [
+        this.deliveryForms.sign_in && this.deliveryForms.sign_in.orderStatus === 402,
+        this.deliveryForms.sign_in && this.deliveryForms.sign_in.orderStatus === 401,
+        this.deliveryForms.user_sending && this.deliveryForms.user_sending.orderStatus === 300,
+        this.deliveryForms.user_arrives && this.deliveryForms.user_arrives.orderStatus === 202,
+        this.deliveryForms.user_take_order && this.deliveryForms.user_take_order.orderStatus === 201,
+        this.deliveryForms.create_order_success && this.deliveryForms.create_order_success.orderStatus === 100
+      ];
 
-    // 找出最后一个为真的步骤的索引
-    for (let i = steps.length - 1; i >= 0; i--) {
-      if (steps[i]) return i;
-    }
+      // 找出最后一个为真的步骤的索引
+      for (let i = steps.length - 1; i >= 0; i--) {
+        if (steps[i]) return i;
+      }
 
-    // 如果没有任何步骤是激活的,返回-1或者你可以选择返回0显示第一步
-    return -1;
-  }
+      // 如果没有任何步骤是激活的,返回-1或者你可以选择返回0显示第一步
+      return -1;
+    }
   },
   mounted() {
     /**/ this.id = this.$route.params.id;
@@ -740,6 +680,103 @@ export default {
     /* this.generateMap(regionData); */
   },
   methods: {
+    /* 出库扫码 */
+    toSearch() {
+      API_GoodsExchange.getProduct(
+        this.deliveryForms.warehouse_id,
+        this.scanGoodsForm.bar_code.replace(/\s+/g, '')
+      ).then((res) => {
+        res.sn_code_list = []
+        this.sku = res.product_vo.sku;
+        // 查找当前商品是否已存在于列表中
+        const indexs = this.goodsExchangeAddForm.product_list.findIndex((el) => {
+          return (
+            el.goods_id === res.goods_id &&
+            el.product_id === res.product_id &&
+            el.warehouse_id === res.warehouse_id &&
+            el.product_vo.sku === res.product_vo.sku
+          );
+        });
+        // 如果商品不存在,则添加到列表
+        if (indexs === -1) {
+          // 检查是否有相同商品在product_list中
+          const existingProduct = this.product_list.find(el => (
+            el.goods_id === res.goods_id &&
+            el.product_id === res.product_id &&
+            el.product_vo.sku === res.product_vo.sku
+          ));
+
+          if (!existingProduct) {
+            this.$message.error('订单内没有该商品,请重新录入');
+            this.$nextTick(() => {
+              this.$refs.input.focus();
+            });
+            return; // 退出函数,不继续执行
+          }
+          this.index = this.goodsExchangeAddForm.product_list.length
+          this.goodsExchangeAddForm.product_list.push(res);
+        } else {
+          this.index = indexs
+        }
+        if (res.product_vo.have_sn) {
+          this.$nextTick(() => {
+            this.$refs.sn_input.focus();
+          });
+        } else {
+          this.scanDialogVisible = false;
+        }
+      });
+    },
+    // 扫码出库
+    scanCode() {
+      this.scanDialogVisible = true;
+      this.$nextTick(() => {
+        this.$refs.input.focus();
+      });
+    },
+    //扫序列号goodsExchangeAddForm.product_list[this.index].sn_code_list
+    toSnCode() {
+      API_GoodsExchange.getSnCode("out", this.sku, this.sn_code.replace(/\s+/g, '')).then((res) => {
+        this.sn_code = "";
+        // 假设res是一个对象,我们根据res的某个属性(如sn)来检查重复
+        let exists = this.goodsExchangeAddForm.product_list[
+          this.index
+        ].sn_code_list.find(
+          (item) => item.sn_code === res.sn_code && item.sku === res.sku
+        );
+        if (!exists) {
+          this.goodsExchangeAddForm.product_list[this.index].sn_code_list.push(
+            res
+          );
+        }
+        this.goodsExchangeAddForm.product_list[this.index].num = this.goodsExchangeAddForm.product_list[this.index].sn_code_list.length
+        const indexs = this.product_list.findIndex((el) => {
+          return (
+            el.goods_id === res.goods_id &&
+            el.product_id === res.product_id &&
+            el.product_vo.sku === res.sku
+          );
+        });
+        this.goodsExchangeAddForm.product_list[this.index].id = this.product_list[indexs].id
+        if (this.goodsExchangeAddForm.product_list[this.index].num == this.product_list[indexs].num) {
+          this.scanGoodsForm.bar_code = "";
+          this.scanDialogVisible = false;
+        } else {
+          this.scanGoodsForm.bar_code = "";
+          this.$nextTick(() => {
+            this.$refs.input.focus();
+          });
+        }
+
+      });
+    },
+    addSnCode(row, index) {
+      this.sku = row.product_vo.sku;
+      this.index = index;
+      this.snCodeVisible = true;
+    },
+
+
     safeAccess(obj, key) {
       return obj ? obj[key] : '';
     },
@@ -811,7 +848,7 @@ export default {
     },
 
     //获取地址
-    handleChange(value) {},
+    handleChange(value) { },
     /** 获取人员列表 */
     GET_AdministratorList() {
       API_Auth.getAdministratorList({
@@ -823,7 +860,9 @@ export default {
       });
     },
     saveErpWarehouseOut() {
-      API_order.outOrderSend(this.id).then((res) => {
+      const params = this.goodsExchangeAddForm
+      params.order_item_vos = params.product_list
+      API_order.outOrderSend(this.id, params).then((res) => {
         this.$router.push({ name: "warehouseOut" });
       });
       return;
@@ -888,9 +927,10 @@ export default {
       API_order.getSendOrderDetail(this.id).then((res) => {
         res.product_list = res.order_item_vos;
         this.product_list = res.order_item_vos;
-        console.log(JSON.stringify(res.create_order_fail)=='{}');
-
+        this.selectedOptions =res.warehouse_vo.ware_pro_city_area.split(",")
+        this.receiverOptions = res.order_vo.province_city_area.split(",");
         if (this.outType !== undefined || res.kdn_order_code !== undefined) {
+          this.goodsExchangeAddForm.product_list = res.order_item_vos
           this.disabledType = true;
           this.deliveryForms.appointment_type = res.appointment_type;
           this.deliveryForms.appointment_time = res.appointment_time;
@@ -913,15 +953,6 @@ export default {
             JSON.stringify(res.order_fee) == "{}" ||
             JSON.stringify(res.sign_in) == "{}"
           ) {
-            /* let arr =[]
-            arr.push(res.create_order_fail)
-            arr.push(res.create_order_success)
-            arr.push(res.user_take_order)
-            arr.push(res.user_arrives)
-            arr.push(res.user_sending)
-            arr.push(res.order_fee)
-            arr.push(res.sign_in)
-            console.log(arr);*/
             this.deliveryForms.sign_in = res.sign_in;
             this.deliveryForms.create_order_fail = res.create_order_fail;
             this.deliveryForms.create_order_success = res.create_order_success;
@@ -930,20 +961,41 @@ export default {
             this.deliveryForms.user_sending = res.user_sending;
             this.deliveryForms.order_fee = res.order_fee;
           }
+        } else {
+          const params = this.deliveryForms
+          params.sender.name = res.warehouse_vo.user_name;
+          params.sender.phone = res.warehouse_vo.phone;
+          //this.selectedOptions = res.warehouse_vo.ware_pro_city_area.split(",")
+          params.sender.province_name =
+            codeToText[this.selectedOptions[0]];
+          params.sender.city_name = codeToText[this.selectedOptions[1]];
+          params.sender.area_name = codeToText[this.selectedOptions[2]];
+          params.sender.address = res.warehouse_vo.warehouse_address;
+          params.receiver.name = res.order_vo.customer_name;
+          params.receiver.phone = res.order_vo.customer_phone;
+          //this.receiverOptions = res.order_vo.province_city_area.split(",");
+          params.receiver.province_name =
+            codeToText[this.receiverOptions[0]];
+          params.receiver.city_name =
+            codeToText[this.receiverOptions[1]];
+          params.receiver.area_name =
+            codeToText[this.receiverOptions[2]];
+          params.receiver.address = res.order_vo.address;
+
         }
         res.order_item_vos.map((el) => {
           this.deliveryForms.total_weight = Number(
             el.product_vo.weight * el.num
           );
         });
+        this.deliveryForms.warehouse_id = res.warehouse_id
         this.deliveryForms.declared_value = Number(res.order_vo.real_price);
-        if (res.send_address && res.receiver_address) {
+        /* if (res.send_address && res.receiver_address) {
           this.selectedOptions = res.send_address.split(",");
           this.receiverOptions = res.receive_address.split(",");
-        }
-
+        } 
         console.log(this.deliveryForms);
-        /* this.deliveryForms.sender=res.sender_province_name */
+        this.deliveryForms.sender=res.sender_province_name */
       });
     },
     /** 出库前预览 */
@@ -1033,17 +1085,22 @@ export default {
   z-index: 999;
   margin-top: 30px;
 }
+
 /deep/ .el-form-item__content {
   display: flex;
   align-items: center;
+
   .el-input {
     width: 300px;
   }
 }
+
 /* 覆盖步骤条的数字为圆点 */
 /deep/.el-steps__icon {
-  background-color: #409eff; /* 蓝色背景 */
-  color: #409eff; /* 蓝色文字,与背景同色,使数字不可见 */
+  background-color: #409eff;
+  /* 蓝色背景 */
+  color: #409eff;
+  /* 蓝色文字,与背景同色,使数字不可见 */
 }
 
 /* 调整圆点的大小 */
@@ -1051,11 +1108,11 @@ export default {
   width: 10px;
   height: 10px;
   border-radius: 50%;
-  background-color: white; /* 白色圆点 */
+  background-color: white;
+  /* 白色圆点 */
   transform: translate(-50%, -50%);
   position: absolute;
   top: 50%;
   left: 50%;
 }
 </style>
-

+ 45 - 88
manager-admin/src/views/stock/warehouseList.vue

@@ -3,19 +3,11 @@
     <en-table-layout :tableData="tableData.data" :loading="loading">
       <div slot="toolbar" class="inner-toolbar">
         <div class="toolbar-btns">
-          <el-button
-            size="mini"
-            v-if="checkPermission(['stock:add'])"
-            type="primary"
-            @click="handleAddWarehouse"
-            >新增</el-button
-          >
+          <el-button size="mini" v-if="checkPermission(['stock:add'])" type="primary"
+            @click="handleAddWarehouse">新增</el-button>
         </div>
         <div class="toolbar-search">
-          <en-table-search
-            @search="searchEvent"
-            placeholder="请输入关键字搜索"
-          />
+          <en-table-search @search="searchEvent" placeholder="请输入关键字搜索" />
         </div>
       </div>
 
@@ -26,25 +18,21 @@
           <template slot-scope="scope">
             {{ adminName(scope.row.admin_id) }}
           </template>
-        </el-table-column> -->
+</el-table-column> -->
         <el-table-column prop="phone" label="负责人手机号" />
         <el-table-column prop="name" label="仓库地址">
           <template slot-scope="scope">
             {{
               adminName(scope.row.ware_pro_city_area) +
-                scope.row.warehouse_address || ""
+              scope.row.warehouse_address || ""
             }}
           </template>
         </el-table-column>
         <el-table-column prop="description" label="仓库说明" />
         <el-table-column label="操作">
           <template slot-scope="scope">
-            <el-button
-              size="mini"
-              v-if="checkPermission(['stock:edit'])"
-              @click="handleEditWarehouse(scope.$index, scope.row)"
-              >编辑</el-button
-            >
+            <el-button size="mini" v-if="checkPermission(['stock:edit'])"
+              @click="handleEditWarehouse(scope.$index, scope.row)">编辑</el-button>
             <!-- <el-button
               size="mini"
               v-if="checkPermission(['stock:del'])"
@@ -56,88 +44,40 @@
         </el-table-column>
       </template>
 
-      <el-pagination
-        v-if="tableData"
-        slot="pagination"
-        @size-change="handlePageSizeChange"
-        @current-change="handlePageCurrentChange"
-        :current-page="tableData.page_no"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="tableData.page_size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="tableData.data_total"
-      >
+      <el-pagination v-if="tableData" slot="pagination" @size-change="handlePageSizeChange"
+        @current-change="handlePageCurrentChange" :current-page="tableData.page_no" :page-sizes="[10, 20, 50, 100]"
+        :page-size="tableData.page_size" layout="total, sizes, prev, pager, next, jumper" :total="tableData.data_total">
       </el-pagination>
     </en-table-layout>
-    <el-dialog
-      :title="stockForm.id ? '编辑仓库' : '添加仓库'"
-      :visible.sync="dialogVisible"
-      width="500px"
-      @open="handleDialogOpen"
-      :modal-append-to-body="false"
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-    >
-      <el-form
-        :model="stockForm"
-        :rules="stockRules"
-        ref="stockForm"
-        label-width="120px"
-      >
+    <el-dialog :title="stockForm.id ? '编辑仓库' : '添加仓库'" :visible.sync="dialogVisible" width="500px"
+      @open="handleDialogOpen" :modal-append-to-body="false" :close-on-click-modal="false"
+      :close-on-press-escape="false">
+      <el-form :model="stockForm" :rules="stockRules" ref="stockForm" label-width="120px">
         <el-form-item label="仓库编号" prop="sn">
-          <el-input
-            v-model="stockForm.sn"
-            :minlength="2"
-            :maxlength="4"
-            clearable
-            placeholder="请输入仓库编号"
-          ></el-input>
+          <el-input v-model="stockForm.sn" :minlength="2" :maxlength="4" clearable placeholder="请输入仓库编号"></el-input>
         </el-form-item>
         <el-form-item label="仓库名称" prop="name">
-          <el-input
-            v-model="stockForm.name"
-            :minlength="2"
-            :maxlength="20"
-            clearable
-            placeholder="请输入仓库名称"
-          ></el-input>
+          <el-input v-model="stockForm.name" :minlength="2" :maxlength="20" clearable placeholder="请输入仓库名称"></el-input>
+        </el-form-item>
+        <el-form-item label="负责人姓名" prop="">
+          <el-select v-model="stockForm.admin_id" clearable @change="selUser">
+            <el-option v-for="item in marketingList" :key="item.id" :label="item.real_name" :value="item.id" />
+          </el-select>
         </el-form-item>
-        <!-- <el-form-item label="负责人姓名" prop="">
-          <el-input v-model="stockForm" clearable placeholder="请输入负责人名称"></el-input>
-        </el-form-item> -->
         <el-form-item label="负责人电话" prop="phone">
-          <el-input
-            v-model="stockForm.phone"
-            :minlength="2"
-            :maxlength="20"
-            clearable
-            placeholder="请输入负责人电话"
-          ></el-input>
+          <el-input v-model="stockForm.phone" :minlength="2" :maxlength="20" clearable
+            placeholder="请输入负责人电话"></el-input>
         </el-form-item>
         <el-form-item label="仓库地址" prop="">
-          <el-cascader
-            size="large"
-            :options="options"
-            clearable
-            v-model="selectedOptions"
-            @change="handleChange"
-          >
+          <el-cascader size="large" :options="options" clearable v-model="selectedOptions" >
           </el-cascader>
           <span>
-            <el-input
-              style="margin-top: 10px"
-              v-model="stockForm.warehouse_address"
-              placeholder="请输入"
-            ></el-input>
+            <el-input style="margin-top: 10px" v-model="stockForm.warehouse_address" placeholder="请输入"></el-input>
           </span>
         </el-form-item>
         <el-form-item label="备注" prop="description">
-          <el-input
-            v-model="stockForm.description"
-            type="textarea"
-            :autosize="{ minRows: 3, maxRows: 4 }"
-            placeholder="请输入备注"
-          ></el-input>
+          <el-input v-model="stockForm.description" type="textarea" :autosize="{ minRows: 3, maxRows: 4 }"
+            placeholder="请输入备注"></el-input>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
@@ -200,6 +140,7 @@ export default {
       dialogVisible: false,
       options: regionData,
       selectedOptions: [],
+      marketingList: [], // 销售经理列表
     };
   },
   mounted() {
@@ -207,11 +148,26 @@ export default {
     this.GET_DeptList();
     // this.GET_StationAllList()
     this.GET_AdministratorList();
+    this.GET_MarketingList();
   },
   computed: {
     ...mapGetters(["user"]),
   },
   methods: {
+    /* 选择负责人 */
+    selUser(selectedUserId) {
+      const selectedUser = this.marketingList.find(user => user.id === selectedUserId);
+      this.stockForm.user_name = selectedUser ? selectedUser.real_name : null;
+      this.stockForm.admin_id = selectedUser ? selectedUser.id : null;
+      /* this.stockForm.user_name=val.real_name
+      this.stockForm.admin_id=val.id */
+    },
+    /** 获取销售经理列表 */
+    GET_MarketingList() {
+      API_BasicSetting.getUserByDept().then((res) => {
+        this.marketingList = res;
+      });
+    },
     adminName(val) {
       let text = "";
       if (val !== undefined) {
@@ -289,7 +245,7 @@ export default {
             this.GET_WarehouseList();
           });
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     /** dialog打开后重置form表单校验结果 */
     handleDialogOpen() {
@@ -310,6 +266,7 @@ export default {
           params.admin_id = JSON.parse(
             JSON.parse(localStorage.getItem("admin_user")).data
           ).uid;
+          params.ware_pro_city_area = this.selectedOptions.join(",");
           if (id) {
             API_BasicSetting.editWarehouse(id, params).then((response) => {
               this.dialogVisible = false;

+ 287 - 388
manager-admin/src/views/stock/warehouseOut.vue

@@ -11,18 +11,9 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="订单日期">
-              <el-date-picker
-                v-model="advancedForm.goodsExchange_time_range"
-                type="daterange"
-                align="center"
-                :editable="false"
-                unlink-panels
-                :clearable="false"
-                :default-time="['00:00:00', '23:59:59']"
-                range-separator="-"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-                value-format="timestamp"
+              <el-date-picker v-model="advancedForm.goodsExchange_time_range" type="daterange" align="center"
+                :editable="false" unlink-panels :clearable="false" :default-time="['00:00:00', '23:59:59']"
+                range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" value-format="timestamp"
                 :picker-options="{
                   disabledDate(time) {
                     return (
@@ -32,50 +23,35 @@
                         new Date().getMonth(),
                         new Date().getDate()
                       ).getTime() +
-                        86400000 -
-                        1
+                      86400000 -
+                      1
                     );
                   },
                   shortcuts: MixinPickerShortcuts,
-                }"
-              >
+                }">
               </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="仓库">
               <el-select v-model="advancedForm.warehouse_id">
-                <el-option
-                  v-for="item in warehouseList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="订单编号">
-              <el-input
-                v-model="advancedForm.sn"
-                placeholder="请输入订单编号"
-              ></el-input>
+              <el-input v-model="advancedForm.sn" placeholder="请输入订单编号"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
       <el-button @click="advancedSearchEvent"> 搜索 </el-button>
     </div>
-    <en-table-layout
-      :tableData="tableData.records"
-      :loading="loading"
-      @selection-change="handleSelectionChange"
-    >
+    <en-table-layout :tableData="tableData.records" :loading="loading" @selection-change="handleSelectionChange" :row-style="changRed">
       <div slot="toolbar" class="inner-toolbar">
         <div class="toolbar-btns">
-          <span v-if="params.selectType == 'sending'"
-            >已发货:{{ tableData.total }}</span
-          >
+          <span v-if="params.selectType == 'sending'">已发货:{{ tableData.total }}</span>
           <!-- <el-button size="mini" @click="addWarehouse">新增</el-button>
           <el-button size="mini">发货</el-button>
           <el-button size="mini" v-if="checkPermission(['warehouseOut:del'])" @click="handleDeleteWarehouseOut()" type="danger"
@@ -85,7 +61,7 @@
       <template slot="table-columns">
         <el-table-column type="selection" width="55" />
         <el-table-column prop="sn" label="订单编号" />
-        <el-table-column prop="" label="出库单编号">
+        <el-table-column prop="" label="出库单编号" v-if="params.selectType == 'sending'">
           <template slot-scope="scope">
             {{ scope.row.order_vo.warehouse_out_id }}
           </template>
@@ -98,7 +74,7 @@
         <el-table-column prop="order_time" label="下单时间">
           <template slot-scope="scope">{{
             scope.row.order_vo.order_time | unixToDate
-          }}</template>
+            }}</template>
         </el-table-column>
         <el-table-column prop="warehouse_name" label="仓库名称">
           <template slot-scope="scope">
@@ -108,7 +84,7 @@
         <el-table-column prop="" label="配送方式">
           <template slot-scope="scope">{{
             deliveryType(scope.row.order_vo.send_type)
-          }}</template>
+            }}</template>
         </el-table-column>
         <!--        <el-table-column prop="distribution_name" label="销售经理" />-->
         <el-table-column prop="" label="付款方式">
@@ -120,74 +96,38 @@
         <el-table-column prop="status" label="状态">
           <template slot-scope="scope">{{
             typeName(scope.row.status)
-          }}</template>
+            }}</template>
         </el-table-column>
         <!-- <el-table-column prop="status" label="发货状态">
           <template slot-scope="scope">{{ statusFilter(scope.row.status) }}</template>
         </el-table-column> -->
         <el-table-column label="操作" width="250">
           <template slot-scope="scope">
-            <el-button
-              size="mini"
-              v-if="scope.row.status !== 'TO_BE_SEND'"
-              type="success"
-              @click="handleAuditDialog(scope.row)"
-              >查看</el-button
-            >
+            <el-button size="mini" v-if="scope.row.status !== 'TO_BE_SEND'" type="success"
+              @click="handleAuditDialog(scope.row)">查看</el-button>
             <!---->
             <!--  <el-button size="mini" v-if="scope.row.allowable.ship && checkPermission(['warehouseOut:send'])" type="success"
               @click="handleSendWarehouseOut(scope.row)">发货</el-button> -->
-            <el-button
-              v-if="scope.row.status == 'TO_BE_SEND'"
-              size="mini"
-              @click="addWarehouse(scope.row)"
-              >发货</el-button
-            >
-            <el-button
-              type="primary"
-              size="mini"
-              @click="handlePrintWarehouseOutDialog(scope.row)"
-              >删除</el-button
-            >
+            <el-button v-if="scope.row.status == 'TO_BE_SEND'" size="mini"
+              @click="addWarehouse(scope.row)">发货</el-button>
+            <!-- <el-button type="primary" size="mini" @click="handlePrintWarehouseOutDialog(scope.row)">删除</el-button> -->
           </template>
         </el-table-column>
       </template>
 
-      <el-pagination
-        v-if="tableData"
-        slot="pagination"
-        @size-change="handlePageSizeChange"
-        @current-change="handlePageCurrentChange"
-        :current-page="tableData.pages"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="tableData.size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="tableData.total"
-      >
+      <el-pagination v-if="tableData" slot="pagination" @size-change="handlePageSizeChange"
+        @current-change="handlePageCurrentChange" :current-page="tableData.pages" :page-sizes="[10, 20, 50, 100]"
+        :page-size="tableData.size" layout="total, sizes, prev, pager, next, jumper" :total="tableData.total">
       </el-pagination>
     </en-table-layout>
 
-    <el-dialog
-      title="出库单表"
-      :visible.sync="dialogVisible"
-      width="940px"
-      center
-    >
-      <el-button
-        size="mini"
-        type="primary"
-        @click="handlePrintWarehouseOut"
-        class="print"
-        >打印</el-button
-      >
+    <el-dialog title="出库单表" :visible.sync="dialogVisible" width="940px" center>
+      <el-button size="mini" type="primary" @click="handlePrintWarehouseOut" class="print">打印</el-button>
       <div id="deliverySheet" style="width: 900px">
         <div class="tips-t">
           <div>
-            仓库名称编码:<span v-if="warehouseOutForm.dept_name"
-              >{{ warehouseOutForm.dept_name }}部门</span
-            ><span v-if="warehouseOutForm.warehouse_name"
-              >{{ warehouseOutForm.warehouse_name }}仓库</span
-            >
+            仓库名称编码:<span v-if="warehouseOutForm.dept_name">{{ warehouseOutForm.dept_name }}部门</span><span
+              v-if="warehouseOutForm.warehouse_name">{{ warehouseOutForm.warehouse_name }}仓库</span>
           </div>
           <div>日期:{{ warehouseOutForm.out_time | unixToDateStr }}</div>
           <div>编号:{{ warehouseOutForm.sn }}</div>
@@ -199,13 +139,8 @@
             <!--            用户收货地址:{{ warehouseOutForm.ship_addr }}-->
           </div>
         </div>
-        <el-table
-          :data="warehouseOutForm.item_list"
-          border
-          :cell-style="{ textAlign: 'center' }"
-          :header-cell-style="{ textAlign: 'center', background: '#f4f4f4' }"
-          style="width: 100%; margin-top: 20px"
-        >
+        <el-table :data="warehouseOutForm.item_list" border :cell-style="{ textAlign: 'center' }"
+          :header-cell-style="{ textAlign: 'center', background: '#f4f4f4' }" style="width: 100%; margin-top: 20px">
           <el-table-column label="产品编码">
             <template slot-scope="scope">
               {{ scope.row.product_sn }}
@@ -241,97 +176,51 @@
       </div>
     </el-dialog>
     <el-dialog title="订单发货" :visible.sync="dialogSendVisible" width="450px">
-      <el-form
-        :model="warehouseOutForms"
-        ref="warehouseOutForms"
-        label-width="120px"
-      >
+      <el-form :model="warehouseOutForms" ref="warehouseOutForms" label-width="120px">
         <el-form-item label="出库单号:" prop="name">
           {{ warehouseOutForms.sn }}
         </el-form-item>
         <el-form-item label="订单编号:" prop="sn">
           <span v-if="warehouseOutForms.order_sn_list">{{
             formatFilter(warehouseOutForms.order_sn_list)
-          }}</span>
+            }}</span>
         </el-form-item>
         <el-form-item label="配送方式:" prop="category_id">
-          <el-radio
-            v-model="warehouseOutForms.delivery_type"
-            :label="'express'"
-            :disabled="true"
-            >物流配送</el-radio
-          >
-          <el-radio
-            v-model="warehouseOutForms.delivery_type"
-            :label="'self_pick'"
-            :disabled="true"
-            >自提</el-radio
-          >
+          <el-radio v-model="warehouseOutForms.delivery_type" :label="'express'" :disabled="true">物流配送</el-radio>
+          <el-radio v-model="warehouseOutForms.delivery_type" :label="'self_pick'" :disabled="true">自提</el-radio>
         </el-form-item>
         <span v-if="warehouseOutForms.delivery_type === 'self_pick'">
           <el-form-item label="自提点:" prop="store_id">
             {{ warehouseOutForms.store_name }}
           </el-form-item>
           <el-form-item label="物流费用:" prop="freight_price">
-            <el-input
-              v-model="warehouseOutForms.freight_price"
-              type="number"
-              oninput="value=parseInt(value.replace(/[^\d]/g,''))"
-              :minlength="1"
-              :maxlength="20"
-              clearable
-              placeholder="请输入物流费用"
-            ></el-input>
+            <el-input v-model="warehouseOutForms.freight_price" type="number"
+              oninput="value=parseInt(value.replace(/[^\d]/g,''))" :minlength="1" :maxlength="20" clearable
+              placeholder="请输入物流费用"></el-input>
           </el-form-item>
           <el-form-item label="提货人:" prop="consignee">
-            <el-input
-              v-model="warehouseOutForms.consignee"
-              :minlength="1"
-              :maxlength="20"
-              clearable
-              placeholder="请输入提货人"
-            ></el-input>
+            <el-input v-model="warehouseOutForms.consignee" :minlength="1" :maxlength="20" clearable
+              placeholder="请输入提货人"></el-input>
           </el-form-item>
         </span>
         <span v-else>
           <el-form-item label="物流公司:" prop="logistics_company_id">
             <el-select v-model="warehouseOutForms.logistics_company_id">
-              <el-option
-                v-for="item in expressCompanyList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              />
+              <el-option v-for="item in expressCompanyList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
           </el-form-item>
           <el-form-item label="物流单号:" prop="tracking_number">
-            <el-input
-              v-model="warehouseOutForms.tracking_number"
-              :minlength="1"
-              :maxlength="20"
-              clearable
-              placeholder="请输入物流单号"
-            ></el-input>
+            <el-input v-model="warehouseOutForms.tracking_number" :minlength="1" :maxlength="20" clearable
+              placeholder="请输入物流单号"></el-input>
           </el-form-item>
           <el-form-item label="物流费用:" prop="freight_price">
-            <el-input
-              v-model="warehouseOutForms.freight_price"
-              type="number"
-              oninput="value=parseInt(value.replace(/[^\d]/g,''))"
-              :minlength="1"
-              :maxlength="20"
-              clearable
-              placeholder="请输入物流费用"
-            ></el-input>
+            <el-input v-model="warehouseOutForms.freight_price" type="number"
+              oninput="value=parseInt(value.replace(/[^\d]/g,''))" :minlength="1" :maxlength="20" clearable
+              placeholder="请输入物流费用"></el-input>
           </el-form-item>
           <el-form-item label="提货人:" prop="consignee">
-            <el-input
-              v-model="warehouseOutForms.consignee"
-              :minlength="1"
-              :maxlength="20"
-              clearable
-              placeholder="请输入提货人"
-            ></el-input>
+            <el-input v-model="warehouseOutForms.consignee" :minlength="1" :maxlength="20" clearable
+              placeholder="请输入提货人"></el-input>
           </el-form-item>
         </span>
       </el-form>
@@ -346,9 +235,7 @@
       <el-radio v-model="auditStatus" label="AUDIT_REJECT">驳回</el-radio>
       <div class="btn-box">
         <el-button type="" @click="auditVisible = false">取消</el-button>
-        <el-button type="primary" @click="handleAuditWarehouseOut"
-          >提交</el-button
-        >
+        <el-button type="primary" @click="handleAuditWarehouseOut">提交</el-button>
       </div>
     </el-dialog>
   </div>
@@ -420,253 +307,260 @@ export default {
     },
   },
   methods: {
-    memberType(val) {
-      let name = "";
-      this.customerList.map((el) => {
-        if (el.id == val) {
-          return (name = el.name);
+    changRed({ row }) {
+      if (row.subtract_stock) { // 变颜色的条件
+        return {
+          color: "red"  // 这个return的就是样式 可以是color 也可以是backgroundColor
         }
-      });
-      return name;
+      }
     },
-    //获取付款方式
-    payType(val) {
-      let name = "";
-      API_CollectingAccount.getList({
-        page_no: 1,
-        page_size: -1,
-        enable_flag: true,
-      }).then((response) => {
-        this.collectingAccountList = response.data;
-        this.collectingAccountList.map((el) => {
+      memberType(val) {
+        let name = "";
+        this.customerList.map((el) => {
           if (el.id == val) {
             return (name = el.name);
           }
         });
         return name;
-      });
-    },
-    //配送方式查看
-    deliveryType(val) {
-      let name = "";
-      this.deliveryTypeList.map((el) => {
-        if (el.code == val) {
-          return (name = el.name);
+      },
+      //获取付款方式
+      payType(val) {
+        let name = "";
+        API_CollectingAccount.getList({
+          page_no: 1,
+          page_size: -1,
+          enable_flag: true,
+        }).then((response) => {
+          this.collectingAccountList = response.data;
+          this.collectingAccountList.map((el) => {
+            if (el.id == val) {
+              return (name = el.name);
+            }
+          });
+          return name;
+        });
+      },
+      //配送方式查看
+      deliveryType(val) {
+        let name = "";
+        this.deliveryTypeList.map((el) => {
+          if (el.code == val) {
+            return (name = el.name);
+          }
+        });
+        return name;
+      },
+      //获取仓库名称
+      warehouseName(val) {
+        let name = [];
+        this.warehouseList.map((el) => {
+          val.map((e) => {
+            if (el.id == e) {
+              return name.push(el.name);
+            }
+          });
+        });
+        return name.join("/");
+      },
+      //获取订单状态大小写转换.toUpperCase()
+      typeName(val) {
+        let name = "";
+        this.orderType.map((el) => {
+          if (el.value == val) {
+            return (name = el.label);
+          }
+        });
+        return name;
+      },
+      /* 切换发货列表 */
+      handleClick(tab, event) {
+        if (tab.name == "to_be_send") {
+          this.params.selectType = tab.name;
+          this.GET_WarehouseOutList();
+        } else {
+          this.params.selectType = tab.name;
+          this.GET_WarehouseOutList();
         }
-      });
-      return name;
-    },
-    //获取仓库名称
-    warehouseName(val) {
-      let name = [];
-      this.warehouseList.map((el) => {
-        val.map((e) => {
-          if (el.id == e) {
-            return name.push(el.name);
+      },
+      addWarehouse(row) {
+        this.$router.push({
+          name: "orderOutboundAdd",
+          params: { id: row.id },
+        });
+        // this.$router.params{ name: 'orderOutboundDetail', params: { id: scope.row.id } }
+      },
+      /** 查看 */
+      handleAuditDialog(row) {
+        this.$router.push({
+          name: "orderOutboundAdd",
+          params: { id: row.id, type: "check" },
+        });
+      },
+      /** 审核提交 */
+      handleAuditWarehouseOut() {
+        API_Order.handleAuditWarehouseOut(this.auditId, {
+          status: this.auditStatus,
+        }).then((response) => {
+          this.$message.success("提交成功!");
+          this.auditVisible = false;
+          this.GET_WarehouseOutList();
+        });
+      },
+      GET_ExpressCompanyList() {
+        API_Order.getExpressCompanyList({ page_no: 1, page_size: 9999 }).then(
+          (response) => {
+            this.expressCompanyList = response.data;
           }
+        );
+      },
+      warehouseOutShip() {
+        API_Order.warehouseOutShip(this.warehouseOutForms).then((response) => {
+          this.$message.success("发货成功!");
+          this.GET_WarehouseOutList();
+          this.dialogSendVisible = false;
         });
-      });
-      return name.join("/");
-    },
-    //获取订单状态大小写转换.toUpperCase()
-    typeName(val) {
-      let name = "";
-      this.orderType.map((el) => {
-        if (el.value == val) {
-          return (name = el.label);
+      },
+      formatFilter(val) {
+        return val.join(",");
+      },
+      /** 出库单状态 */
+      statusFilter(val) {
+        switch (val) {
+          case "WAIT_SHIP":
+            return "待发货";
+          case "WAIT_AUDIT":
+            return "待发货";
+          case "SHIP":
+            return "已发货";
+          default:
+            return "";
         }
-      });
-      return name;
-    },
-    /* 切换发货列表 */
-    handleClick(tab, event) {
-      if (tab.name == "to_be_send") {
-        this.params.selectType = tab.name;
+      },
+      /** 获取仓库 */
+      GET_WarehouseList() {
+        API_BasicSetting.getWarehouseListAll().then((response) => {
+          this.warehouseList = response;
+        });
+        API_BasicSetting.customer(this.params).then((response) => {
+          this.customerList = response.data;
+        });
+      },
+      /** 获取部门 */
+      GET_DeptList() {
+        API_Setting.getDeptList().then((response) => {
+          this.deptList = Foundation.buildTree(response, "0");
+        });
+        API_Setting.getPage({ dictType: "Sale_order_send_status" }).then((res) => {
+          this.orderType = res.data;
+        });
+      },
+      /** 打印对账详情 */
+      handlePrintWarehouseOut() {
+        Print({
+          printable: "deliverySheet",
+          type: "html",
+          targetStyles: ["*"],
+          ignoreElements: ["no-logs", "goods-image", "no-btn"],
+        });
+      },
+      handleDeleteWarehouseOut() {
+        this.$confirm("确定要删除这些出库单吗?", "提示", { type: "warning" })
+          .then(() => {
+            const ids = this.multipleSelection.map((item) => item.id);
+            API_Order.deleteWarehouseOut(ids).then(() => {
+              this.$message.success("删除成功!");
+              this.GET_WarehouseOutList();
+            });
+          })
+          .catch(() => { });
+      },
+      /** 多选改变 */
+      handleSelectionChange(val) {
+        this.multipleSelection = val;
+      },
+      /** 分页大小发生改变 */
+      handlePageSizeChange(size) {
+        this.params.page_size = size;
         this.GET_WarehouseOutList();
-      } else {
-        this.params.selectType = tab.name;
+      },
+
+      /** 分页页数发生改变 */
+      handlePageCurrentChange(page) {
+        this.params.page_no = page;
         this.GET_WarehouseOutList();
-      }
-    },
-    addWarehouse(row) {
-      this.$router.push({
-        name: "orderOutboundAdd",
-        params: { id: row.id },
-      });
-      // this.$router.params{ name: 'orderOutboundDetail', params: { id: scope.row.id } }
-    },
-    /** 查看 */
-    handleAuditDialog(row) {
-      this.$router.push({
-        name: "orderOutboundAdd",
-        params: { id: row.id, type: "check" },
-      });
-    },
-    /** 审核提交 */
-    handleAuditWarehouseOut() {
-      API_Order.handleAuditWarehouseOut(this.auditId, {
-        status: this.auditStatus,
-      }).then((response) => {
-        this.$message.success("提交成功!");
-        this.auditVisible = false;
+      },
+
+      /** 发货 */
+      handleSendWarehouseOut(row) {
+        this.warehouseOutForms = row;
+        // this.dialogSendVisible = trueorderOutboundDetail
+        this.$router.push({
+          name: "orderOutboundAdd",
+          params: { id: row.id },
+        });
+      },
+      /** 打印出库单 */
+      handlePrintWarehouseOutDialog(row) {
+        this.GET_WarehouseOutDetail(row.id);
+      },
+      /** 获取出库单详情页面数据 */
+      GET_WarehouseOutDetail(id) {
+        API_Order.getWarehouseOutInfo(id).then((response) => {
+          this.warehouseOutForm = response;
+          if (response.product_list && response.product_list.length) {
+            var str = "";
+            response.product_list.forEach(function (i) {
+              str += i.product_name + "、";
+            });
+          }
+          this.warehouseOutForm.illustrate = str;
+          this.dialogVisible = true;
+        });
+      },
+      /** 搜索事件触发 */
+      searchEvent(data) {
+        this.params = {
+          ...this.params,
+          sn: data,
+        };
+        Object.keys(this.advancedForm).forEach((key) => delete this.params[key]);
+        this.params.page_no = 1;
         this.GET_WarehouseOutList();
-      });
-    },
-    GET_ExpressCompanyList() {
-      API_Order.getExpressCompanyList({ page_no: 1, page_size: 9999 }).then(
-        (response) => {
-          this.expressCompanyList = response.data;
+      },
+      /** 高级搜索事件触发 */
+      advancedSearchEvent() {
+        this.params = {
+          ...this.params,
+          ...this.advancedForm,
+        };
+        delete this.params.start_time;
+        delete this.params.end_time;
+        if (this.advancedForm.warehouseOut_time_range) {
+          this.params.start_time = parseInt(
+            Number(this.advancedForm.warehouseOut_time_range[0]) / 1000
+          );
+          this.params.end_time = parseInt(
+            Number(this.advancedForm.warehouseOut_time_range[1]) / 1000
+          );
         }
-      );
-    },
-    warehouseOutShip() {
-      API_Order.warehouseOutShip(this.warehouseOutForms).then((response) => {
-        this.$message.success("发货成功!");
+        delete this.params.warehouseOut_time_range;
+        this.params.page_no = 1;
         this.GET_WarehouseOutList();
-        this.dialogSendVisible = false;
-      });
-    },
-    formatFilter(val) {
-      return val.join(",");
-    },
-    /** 出库单状态 */
-    statusFilter(val) {
-      switch (val) {
-        case "WAIT_SHIP":
-          return "待发货";
-        case "WAIT_AUDIT":
-          return "待发货";
-        case "SHIP":
-          return "已发货";
-        default:
-          return "";
-      }
-    },
-    /** 获取仓库 */
-    GET_WarehouseList() {
-      API_BasicSetting.getWarehouseListAll().then((response) => {
-        this.warehouseList = response;
-      });
-      API_BasicSetting.customer(this.params).then((response) => {
-        this.customerList = response.data;
-      });
-    },
-    /** 获取部门 */
-    GET_DeptList() {
-      API_Setting.getDeptList().then((response) => {
-        this.deptList = Foundation.buildTree(response, "0");
-      });
-      API_Setting.getPage({ dictType: "Sale_order_send_status" }).then((res) => {
-        this.orderType = res.data;
-      });
-    },
-    /** 打印对账详情 */
-    handlePrintWarehouseOut() {
-      Print({
-        printable: "deliverySheet",
-        type: "html",
-        targetStyles: ["*"],
-        ignoreElements: ["no-logs", "goods-image", "no-btn"],
-      });
-    },
-    handleDeleteWarehouseOut() {
-      this.$confirm("确定要删除这些出库单吗?", "提示", { type: "warning" })
-        .then(() => {
-          const ids = this.multipleSelection.map((item) => item.id);
-          API_Order.deleteWarehouseOut(ids).then(() => {
-            this.$message.success("删除成功!");
-            this.GET_WarehouseOutList();
-          });
-        })
-        .catch(() => {});
-    },
-    /** 多选改变 */
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
-    },
-    /** 分页大小发生改变 */
-    handlePageSizeChange(size) {
-      this.params.page_size = size;
-      this.GET_WarehouseOutList();
-    },
-
-    /** 分页页数发生改变 */
-    handlePageCurrentChange(page) {
-      this.params.page_no = page;
-      this.GET_WarehouseOutList();
-    },
-
-    /** 发货 */
-    handleSendWarehouseOut(row) {
-      this.warehouseOutForms = row;
-      // this.dialogSendVisible = trueorderOutboundDetail
-      this.$router.push({
-        name: "orderOutboundAdd",
-        params: { id: row.id },
-      });
-    },
-    /** 打印出库单 */
-    handlePrintWarehouseOutDialog(row) {
-      this.GET_WarehouseOutDetail(row.id);
-    },
-    /** 获取出库单详情页面数据 */
-    GET_WarehouseOutDetail(id) {
-      API_Order.getWarehouseOutInfo(id).then((response) => {
-        this.warehouseOutForm = response;
-        if (response.product_list && response.product_list.length) {
-          var str = "";
-          response.product_list.forEach(function (i) {
-            str += i.product_name + "、";
+      },
+      /** 获取出库单列表 */
+      GET_WarehouseOutList() {
+        this.loading = true;
+        API_Order.getSaleOrderOutList(this.params)
+          .then((response) => {
+            this.loading = false;
+            this.tableData = response;
+          })
+          .catch(() => {
+            this.loading = false;
           });
-        }
-        this.warehouseOutForm.illustrate = str;
-        this.dialogVisible = true;
-      });
-    },
-    /** 搜索事件触发 */
-    searchEvent(data) {
-      this.params = {
-        ...this.params,
-        sn: data,
-      };
-      Object.keys(this.advancedForm).forEach((key) => delete this.params[key]);
-      this.params.page_no = 1;
-      this.GET_WarehouseOutList();
-    },
-    /** 高级搜索事件触发 */
-    advancedSearchEvent() {
-      this.params = {
-        ...this.params,
-        ...this.advancedForm,
-      };
-      delete this.params.start_time;
-      delete this.params.end_time;
-      if (this.advancedForm.warehouseOut_time_range) {
-        this.params.start_time = parseInt(
-          Number(this.advancedForm.warehouseOut_time_range[0]) / 1000
-        );
-        this.params.end_time = parseInt(
-          Number(this.advancedForm.warehouseOut_time_range[1]) / 1000
-        );
-      }
-      delete this.params.warehouseOut_time_range;
-      this.params.page_no = 1;
-      this.GET_WarehouseOutList();
-    },
-    /** 获取出库单列表 */
-    GET_WarehouseOutList() {
-      this.loading = true;
-      API_Order.getSaleOrderOutList(this.params)
-        .then((response) => {
-          this.loading = false;
-          this.tableData = response;
-        })
-        .catch(() => {
-          this.loading = false;
-        });
+      },
     },
-  },
-};
+  };
 </script>
 
 <style type="text/scss" lang="scss" scoped>
@@ -676,6 +570,7 @@ export default {
   background: #fff;
   overflow: hidden;
   padding: 30px 10px 10px 10px;
+
   /deep/ .el-form-item {
     .el-form-item__content {
       .el-input {
@@ -683,18 +578,22 @@ export default {
       }
     }
   }
+
   .el-button {
     margin-top: -19px;
     margin-left: 20px;
   }
 }
+
 .print {
   margin-left: 790px;
 }
+
 .btn-box {
   text-align: center;
   margin: 30px 0 10px;
 }
+
 .tips-t {
   display: flex;
   padding: 10px 0;