xiaodai2022 2 éve
szülő
commit
c34d72ff1b

+ 12 - 7
src/apis/service/sellOut/salesOrder/detail.js

@@ -13,24 +13,29 @@ export default {
   // 修改状态
   status: (data, params) => http(api + "salestatus", data, "post", params),
   // 获取仓库商品列表
-  getGoodStock: (data, params) => http(api + "checkflist", data, "post", params),
+  getGoodStock: (data, params) =>
+    http(api + "checkflist", data, "post", params),
   // 采购反馈物流费用
   salefee: (data, params) => http(api + "salefee", data, "post", params),
   // 新建发货申请单
   saleout: (data, params) => http(api + "saleoutadd", data, "post", params),
   //延时发货追加地址
   saleaddr: (data, params) => http(api + "saleaddr", data, "post", params),
-
-
+  //发货申请单列表
+  orderOut: (data, params) => http(api + "xsaleout", data, "post", params),
 
   // 新建入库单详情
-  orderininfo: (data, params) => http(api + "orderininfo", data, "post", params),
+  orderininfo: (data, params) =>
+    http(api + "orderininfo", data, "post", params),
   // 异常原因列表
   resultlist: (data, params) => http(api + "resultlist", data, "post", params),
   // 入库单验货
-  orderincheck: (data, params) => http(api + "orderincheck", data, "post", params),
+  orderincheck: (data, params) =>
+    http(api + "orderincheck", data, "post", params),
   // 入库单退货换货
-  orderinreturn: (data, params) => http(api + "orderinreturn", data, "post", params),
+  orderinreturn: (data, params) =>
+    http(api + "orderinreturn", data, "post", params),
   // 发货单状态修改
-  orderinstatus: (data, params) => http(api + "orderinstatus", data, "post", params),
+  orderinstatus: (data, params) =>
+    http(api + "orderinstatus", data, "post", params),
 };

+ 5 - 1
src/components/globalComponents/process-time-line/main.vue

@@ -21,7 +21,11 @@
         >
           {{ item.status_name }}
         </div>
-        <div slot="description">
+        <div
+          slot="description"
+          v-if="index + 1 !== options.length"
+          style="padding: 20px 0 0 0"
+        >
           <p class="name">
             &nbsp;操&nbsp;作&nbsp;人&nbsp;:
             {{ item.action_name ? item.action_name : "未知" }}

+ 6 - 2
src/components/in-addr-model/index.vue

@@ -279,12 +279,12 @@ export default {
       this.$refs.ruleForm.validateField("order_addr");
     },
     beforeUpload(file) {
-      const isLt1M = file.size / 1024 / 1024 < 1;
+      const isLt1M = file.size / 1024 < 500;
       if (isLt1M) {
         return true;
       }
       this.$message({
-        message: "请不要上传大于1MB的文件.",
+        message: "请不要上传大于500KB的文件.",
         type: "warning",
       });
       return false;
@@ -294,6 +294,10 @@ export default {
         this.$message.error("表格无有效数据!");
         return;
       }
+      if (results.length > 500) {
+        this.$message.error("地址数据不能超过500条!");
+        return;
+      }
       let head = [
         "收货总数",
         "收货联系人",

+ 0 - 6
src/views/purchaseIn/purchaseOrder/components/ShowDataTableColumns.js

@@ -83,11 +83,5 @@ export default [
     _slot_: "customer",
     span: 12
   },
-  {
-    prop: "addr_info",
-    label: "收货信息",
-    _slot_: "addr_info",
-    span: 24
-  },
 ]
 

+ 285 - 0
src/views/purchaseIn/purchaseOrder/components/order-out-table.vue

@@ -0,0 +1,285 @@
+<template>
+  <div class="outOrderTable">
+    <el-table
+      ref="addrForm"
+      :data="tableData"
+      border
+      :size="'mini'"
+      style="width: 100%"
+      row-key="key"
+    >
+      <!-- <el-table-column
+        show-overflow-tooltip
+        prop="outCode"
+        label="发货申请单号"
+        width="160"
+      />
+
+      <el-table-column
+        show-overflow-tooltip
+        prop="send_status"
+        label="状态"
+        min-width="105"
+      >
+        <template slot-scope="scope">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '0' ? 'warning' : ''"
+            v-text="
+              (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
+              '--'
+            "
+          ></el-tag>
+        </template>
+      </el-table-column> -->
+      <el-table-column
+        show-overflow-tooltip
+        prop="send_num"
+        label="发货数量"
+        min-width="80"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="contactor"
+        label="联系人"
+        min-width="80"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="mobile"
+        label="联系电话"
+        min-width="110"
+      />
+      <el-table-column show-overflow-tooltip prop="addr" label="收货地址" min-width="170">
+        <template slot-scope="scope">
+          {{ scope.row.addr_info }}{{ scope.row.addr }}
+        </template>
+      </el-table-column>
+    </el-table>
+    <div
+      v-if="tableData && tableData.length > 0"
+      class="Pagination"
+      style="text-align: right; margin-top: 10px"
+    >
+      <el-pagination
+        :current-page="parmValue.page"
+        :page-size="parmValue.size"
+        :size="'mini'"
+        layout="total,  prev, pager, next, jumper"
+        :total="pageInfo.total"
+        @size-change="page_size_change"
+        @current-change="page_curr_change"
+      />
+    </div>
+
+    <!-- <add-edit
+      :id="modelId"
+      :sitem="s_sitem"
+      :show-model="showModel"
+      :is-detail="isDetail"
+      @refresh="searchList"
+      @cancel="showModel = false"
+    /> -->
+  </div>
+</template>
+<script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
+
+import { mapGetters } from "vuex";
+
+export default {
+  name: "salesOrderDetail",
+  mixins: [mixinPage, resToken],
+  props: ["newTime", "id", "sitem"],
+  watch: {
+    newTime: function (val) {
+      if (val) {
+        this.initForm();
+      }
+    },
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "salesOrderDetail"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+
+  data() {
+    return {
+      orderCode: "",
+      outCode: "",
+      addrmodel: false,
+      // 状态
+      statusOptions: [
+        { id: "0", label: "待公司采购" },
+        { id: "1", label: "待库管发货" },
+        { id: "2", label: "已发货待收货" },
+        { id: "3", label: "已收货" },
+        { id: "4", label: "已全部退货" },
+      ],
+      showGoodsModel: false,
+      stock_code: "",
+      tableData: [],
+      loading: false,
+      queryId: "",
+      status: "",
+      showModel: null,
+      modelId: "",
+      modelItem: null,
+      s_sitem: null,
+      returnId: "",
+      returnItem: null,
+      returnModel: false,
+      wsend_num: "",
+      orderCode: "",
+      parmValue: {
+        order_type: "",
+        orderCode: "",
+        apply_name: "", //申请人名称
+        cgdNo: "",
+        start: "",
+        end: "",
+        // supplierNo: "",
+        companyNo: "",
+        good_code: "",
+        good_name: "",
+        outCode: "",
+        status: "",
+        company_name: "", //申请人部门
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+    };
+  },
+  mounted() {
+    this.initForm();
+  },
+  methods: {
+    closeModel() {
+      this.modelId = "";
+      this.modelShowModel = false;
+    },
+    refresh() {
+      this.$emit("refresh");
+      this.modelId = "";
+      this.modelShowModel = false;
+    },
+    async initForm() {
+      this.status = "";
+      this.queryId = this.$route.query.id;
+      // this.rulesThis = this.rules;
+      this.resetForm();
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(async () => {
+        this.wsend_num = true;
+        const { orderCode, status } = this.sitem;
+        this.status = status;
+        this.orderCode = orderCode || "";
+
+        await this.searchList();
+      });
+    },
+    // 列表搜索
+    async searchList() {
+      this.parmValue.orderCode = this.orderCode;
+      if (this.orderCode === "") return;
+      const { code, data, message } = await asyncRequest.orderOut(this.parmValue);
+      if (code === 0) {
+        const { list, count } = data;
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+        this.tableData.forEach((v) => {
+          v.good_class = "";
+          if (v.can && v.can.length > 0) {
+            v.can.forEach((x, i) => {
+              v.good_class += i === 0 ? x.name : "/" + x.name;
+            });
+          }
+        });
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+    editRow(index) {
+      let findex = this.stockForm.good_stock.findIndex((v) => v.edit === true);
+      if (findex !== -1) {
+        this.$message.warning("当前已有发货仓库信息在编辑,请保存后再试!");
+        return;
+      } else {
+        this.stockForm.good_stock[index].edit = true;
+      }
+    },
+
+    openHouseModal() {
+      this.modelId = "add";
+      this.modelItem = this.sitem;
+      this.modelShowModel = true;
+    },
+    openModal() {
+      this.returnId = "add";
+      this.returnItem = this.sitem;
+      this.returnModel = true;
+      console.log(addModel);
+    },
+    async restSearch() {
+      this.parmValue = {
+        order_type: "",
+        orderCode: "",
+        apply_name: "", //申请人名称
+        cgdNo: "",
+        start: "",
+        end: "",
+        // supplierNo: "",
+        companyNo: "",
+        good_code: "",
+        good_name: "",
+        outCode: "",
+        status: "",
+        company_name: "", //申请人部门
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      };
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      await this.searchList();
+    },
+    async page_size_change(e) {
+      this.parmValue.size = e;
+      this.pageInfo.size = e;
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
+    async page_curr_change(e) {
+      this.parmValue.page = e;
+      this.pageInfo.curr = e;
+      await this.searchList();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped></style>

+ 8 - 42
src/views/purchaseIn/purchaseOrder/detail.vue

@@ -155,49 +155,13 @@
                     <i class="el-icon-warning-outline fr" slot="reference"></i>
                   </el-popover>
                 </template>
-
-                <template slot="addr_info">
-                  <el-table
-                    :data="sitem.addr_info"
-                    :size="'mini'"
-                    border
-                    stripe
-                    max-height="240px"
-                    style="width: 100%"
-                  >
-                    <el-table-column
-                      prop="receipt_quantity"
-                      label="发货数量"
-                      show-overflow-tooltip
-                      width="150px"
-                    >
-                    </el-table-column>
-                    <el-table-column
-                      prop="contactor"
-                      label="收货人"
-                      show-overflow-tooltip
-                      width="100px"
-                    >
-                    </el-table-column>
-                    <el-table-column
-                      prop="mobile"
-                      label="联系电话"
-                      show-overflow-tooltip
-                      width="140px"
-                    >
-                    </el-table-column>
-                    <el-table-column
-                      prop="addr_code"
-                      label="收货地址"
-                      show-overflow-tooltip
-                      min-width="500px"
-                    >
-                    </el-table-column>
-                  </el-table>
-                </template>
               </show-data-table>
             </el-collapse-item>
-            <el-collapse-item title="商品信息" name="2">
+
+            <el-collapse-item title="收货信息" name="2">
+              <order-out-table :newTime="newTime" v-if="newTime !== ''" :sitem="sitem" />
+            </el-collapse-item>
+            <el-collapse-item title="商品信息" name="3">
               <show-goods-data-table
                 :newTime="newTime"
                 v-if="newTime !== ''"
@@ -223,7 +187,7 @@
             </el-collapse-item>
             <el-collapse-item
               title="入库单"
-              name="3"
+              name="4"
               v-if="sitem && sitem.status !== '0'"
             >
               <order-in-table
@@ -275,6 +239,7 @@ import { cg_order_type_options } from "@/assets/js/statusList";
 import tolerance from "./components/tolerance";
 import urlConfig from "@/apis/url-config";
 import editPrice from "./components/editPrice";
+import orderOutTable from "./components/order-out-table";
 export default {
   name: "purchaseOrderDetail",
   mixins: [mixinPage, resToken],
@@ -283,6 +248,7 @@ export default {
     tolerance,
     workDiffTable,
     editPrice,
+    orderOutTable,
   },
 
   computed: {

+ 168 - 197
src/views/sellOut/salesOrder/components/order-out-table.vue

@@ -1,13 +1,10 @@
 <template>
   <div class="outOrderTable">
-    <!-- {{wsend_num}}--{{powers.some((i) => i == '051')}} -->
-    <!-- v-if="wsend_num && powers.some((i) => i == '051')" -->
     <el-table
       ref="addrForm"
       :data="tableData"
       border
       :size="'mini'"
-      max-height="300px"
       style="width: 100%"
       row-key="key"
     >
@@ -15,25 +12,17 @@
         show-overflow-tooltip
         prop="outCode"
         label="发货申请单号"
-        width="155"
+        width="160"
       />
 
-      <el-table-column
-        show-overflow-tooltip
-        prop="send_status"
-        label="状态"
-        width="105"
-      >
+      <el-table-column show-overflow-tooltip prop="send_status" label="状态" width="105">
         <template slot-scope="scope">
           <el-tag
             :size="tablebtnSize"
-            :type="scope.row.send_status == '0' ? 'warning' : ''"
+            :type="scope.row.status == '0' ? 'warning' : ''"
             v-text="
-              (
-                statusOptions.find(
-                  (item) => item.id == scope.row.send_status
-                ) || {}
-              ).label || '--'
+              (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
+              '--'
             "
           ></el-tag>
         </template>
@@ -41,28 +30,13 @@
 
       <el-table-column
         show-overflow-tooltip
-        prop="receipt_quantity"
+        prop="send_num"
         label="发货数量"
         width="80"
       />
-      <el-table-column
-        show-overflow-tooltip
-        prop="contactor"
-        label="联系人"
-        width="80"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="mobile"
-        label="联系电话"
-        width="110"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="addr"
-        label="收货地址"
-        min-width="170"
-      >
+      <el-table-column show-overflow-tooltip prop="contactor" label="联系人" width="80" />
+      <el-table-column show-overflow-tooltip prop="mobile" label="联系电话" width="110" />
+      <el-table-column show-overflow-tooltip prop="addr" label="收货地址" min-width="170">
         <template slot-scope="scope">
           {{ scope.row.addr_info }}{{ scope.row.addr }}
         </template>
@@ -71,7 +45,7 @@
         show-overflow-tooltip
         prop="post_name"
         label="物流公司"
-        min-width="110"
+        width="160"
       />
       <el-table-column
         show-overflow-tooltip
@@ -85,18 +59,14 @@
         label="发货时间"
         width="145"
       />
-      <el-table-column fixed="right" width="150">
+      <el-table-column fixed="right" width="120">
         <template slot="header" slot-scope="scope">
-          <span>操作</span>
+          <span v-if="addr_res + '' === '0'">操作</span>
           <el-tooltip
             style="margin: 3px 0 0 8px"
             effect="dark"
             class="fr"
-            v-if="
-              (status === '0' || status === '1') &&
-              powers.some((i) => i == '048') &&
-              sitem.send_type !== '1'
-            "
+            v-if="addr_res + '' !== '0' && powers.some((i) => i == '048')"
             content="添加"
             placement="top"
           >
@@ -110,11 +80,7 @@
             class="fr"
             style="margin: 3px 0 0 8px"
             effect="dark"
-            v-if="
-              (status === '0' || status === '1') &&
-              powers.some((i) => i == '048') &&
-              sitem.send_type !== '1'
-            "
+            v-if="addr_res + '' !== '0' && powers.some((i) => i == '048')"
             content="导入收货地址"
             placement="top"
           >
@@ -128,19 +94,12 @@
             class="fr"
             style="margin: 3px 0 0 8px"
             effect="dark"
-            v-if="
-              (status === '0' || status === '1') &&
-              powers.some((i) => i == '048') &&
-              sitem.send_type !== '1'
-            "
+            v-if="addr_res + '' !== '0' && powers.some((i) => i == '048')"
             content="下载收货地址模板"
             placement="top"
           >
             <a class="downloadAddr" href="./static/收货地址模板.xlsx">
-              <i
-                class="el-icon-download tb-icon"
-                style="color: #63cbe7; margin: 0"
-              ></i>
+              <i class="el-icon-download tb-icon" style="color: #63cbe7; margin: 0"></i>
             </a>
           </el-tooltip>
 
@@ -149,17 +108,13 @@
             effect="dark"
             content="退货"
             class="fr"
-            v-if="
-              wsend_num &&
-              wsend_num !== '0' &&
-              powers.some((i) => i == '051')
-            "
+            v-if="addr_res + '' !== '0' && powers.some((i) => i == '051')"
             placement="top"
           >
             <i
               class="el-icon-delete tb-icon"
               style="color: #63cbe7; magin: 0 0 0 10px"
-              @click="openModal()"
+              @click="openModal(0)"
             ></i>
           </el-tooltip>
         </template>
@@ -173,14 +128,39 @@
           >
             <i
               class="el-icon-view tb-icon"
-              @click="
-                routeGoto('sellOutOrderDetail', { id: scope.row.outCode })
-              "
+              @click="routeGoto('sellOutOrderDetail', { id: scope.row.outCode })"
             ></i>
           </el-tooltip>
+          <el-tooltip
+            effect="dark"
+            content="退货"
+            v-if="
+              (scope.row.status == '0' || scope.row.status == '1') &&
+              powers.some((i) => i == '051')
+            "
+            placement="top"
+          >
+            <i class="el-icon-delete tb-icon" @click="openModal(scope.row)"></i>
+          </el-tooltip>
         </template>
       </el-table-column>
     </el-table>
+    <div
+      v-if="tableData && tableData.length > 0"
+      class="Pagination"
+      style="text-align: right; margin-top: 10px"
+    >
+      <el-pagination
+        :current-page="parmValue.page"
+        :page-size="parmValue.size"
+        :size="'mini'"
+        layout="total,  prev, pager, next, jumper"
+        :total="pageInfo.total"
+        @size-change="page_size_change"
+        @current-change="page_curr_change"
+      />
+    </div>
+
     <out-order-add-model
       :showModel="modelShowModel"
       :id="modelId"
@@ -213,7 +193,7 @@
     /> -->
   </div>
 </template>
-   <script>
+<script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
@@ -251,7 +231,7 @@ export default {
     return {
       orderCode: "",
       outCode: "",
-      is_all: false,
+      addr_res: 0,
       addrmodel: false,
       // 状态
       statusOptions: [
@@ -275,6 +255,30 @@ export default {
       returnItem: null,
       returnModel: false,
       wsend_num: "",
+      orderCode: "",
+      parmValue: {
+        order_type: "",
+        orderCode: "",
+        apply_name: "", //申请人名称
+        cgdNo: "",
+        start: "",
+        end: "",
+        // supplierNo: "",
+        companyNo: "",
+        good_code: "",
+        good_name: "",
+        outCode: "",
+        status: "",
+        company_name: "", //申请人部门
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      resModel: null,
     };
   },
   mounted() {
@@ -296,68 +300,45 @@ export default {
       // this.rulesThis = this.rules;
       this.resetForm();
     },
-    getNewTime() {
-      this.newTime = new Date().valueOf();
-    },
     async resetForm() {
       // 重置
-      await this.$nextTick(() => {
+      await this.$nextTick(async () => {
         this.wsend_num = true;
-        const { addrs, status, wsend_num } = this.sitem;
+        const { orderCode, status, good_num, addr_sum } = this.sitem;
         this.status = status;
-        this.wsend_num = wsend_num || "";
+        this.orderCode = orderCode || "";
+        this.addr_res = parseInt(good_num) - parseInt(addr_sum);
+        if (this.addr_res < 0) {
+          this.addr_res = "0";
+        }
         // console.log(this.status);
-        this.tableData = JSON.parse(JSON.stringify(addrs));
+        await this.searchList();
+        // this.tableData = JSON.parse(JSON.stringify(addrs));
       });
     },
-    async addrRefresh(e) {
-      if (!this.loading) {
-        this.loading = true;
-        const { arrive_time, orderCode, wsend_num } = this.sitem;
-        const { list } = e;
-        console.log(list);
-        let t_num = 0,
-          add_num = 0;
-        let model = {
-          arrtime: arrive_time,
-          orderCode: orderCode,
-          addrlist: [],
-        };
-        list.forEach((a) => {
-          add_num += a.receipt_quantity * 1;
-          let item = {
-            contactor: a.contactor,
-            mobile: a.mobile,
-            addr: a.addr,
-            addr_code: a.addr_code,
-            receipt_quantity: a.receipt_quantity,
-          };
-          model.addrlist.push(item);
+    // 列表搜索
+    async searchList() {
+      this.parmValue.orderCode = this.orderCode;
+      const { code, data, message } = await asyncRequest.orderOut(this.parmValue);
+      if (code === 0) {
+        const { list, count } = data;
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+        this.tableData.forEach((v) => {
+          v.good_class = "";
+          if (v.can && v.can.length > 0) {
+            v.can.forEach((x, i) => {
+              v.good_class += i === 0 ? x.name : "/" + x.name;
+            });
+          }
         });
-        if (wsend_num * 1 < t_num + add_num) {
-          this.$message.warning("导入地址总数量不能大于未发货总数量!");
-          this.loading = false;
-          return;
-        }
-        let res = await asyncRequest.saleaddr(model);
-        this.loading = false;
-        if (res && res.code === 0) {
-          this.$notify.success({
-            title: "地址导入成功!",
-            message: "",
-          });
-          this.showModelThis = false;
-          // 刷新
-          this.$emit("refresh");
-        } else if (res && res.code >= 100 && res.code <= 104) {
-          await this.logout();
-        } else {
-          this.$message.warning(res.message);
-        }
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
       }
-
-      // this.tableData = [];
-      // this.tableData.push(...list);
+      this.loading = false;
     },
     editRow(index) {
       let findex = this.stockForm.good_stock.findIndex((v) => v.edit === true);
@@ -368,91 +349,81 @@ export default {
         this.stockForm.good_stock[index].edit = true;
       }
     },
-    checkStockRow(index) {
-      let total = parseInt(this.stockForm.good_stock[index].usable_stock),
-        num = parseInt(this.stockForm.good_stock[index].num);
-      if (total === 0) {
-        this.$message.warning("该仓库已无该商品库存!不能销售!");
-        return;
-      } else {
-        if (num > total) {
-          this.$message.warning("销售数量不能大于可用库存!");
-          return;
-        } else {
-          this.stockForm.good_stock[index].edit = false;
-        }
-      }
-    },
 
-    //省市区保存某一行
-    checkRow(rowIndex) {
-      this.$refs.addrForm.validate((valid) => {
-        if (valid) {
-          this.tableData[rowIndex].edit = false;
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-    // 省市区删除行操作
-    deleteRow(index, rows) {
-      rows.splice(index, 1);
-    },
-    async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          if (this.loading) {
-            return;
-          }
-          this.loading = true;
-          const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
-          let model = {
-            id: this.queryId,
-            order_addr: [],
-          };
-          order_addr.forEach((v2) => {
-            let model2 = {
-              post_fee: v2.post_fee,
-              id: v2.id,
-            };
-            model.order_addr.push(model2);
-          });
-          let res = await asyncRequest.salefee(model);
-          this.loading = false;
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "反馈物流费用成功!",
-              message: "",
-            });
-            this.showModelThis = false;
-            // 刷新
-            this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
     openHouseModal() {
       this.modelId = "add";
       this.modelItem = this.sitem;
       this.modelShowModel = true;
     },
-    openModal() {
-      this.returnId = "add";
-      this.returnItem = this.sitem;
+    openModal(e) {
+      if (e === 0) {
+        this.resModel = {
+          good_num: this.addr_res + "",
+          orderCode: this.orderCode,
+          return_type: "1",
+          remark: "", //退货备注
+          errorCode: "", //退货原因
+          thnum: this.addr_res + "",
+          returnT: this.addr_res + "",
+          returnAddr: [],
+        };
+        //  scope.row.outCode
+      } else {
+        const { addrid, send_num, outCode } = e;
+        this.resModel = {
+          good_num: send_num + "",
+          orderCode: this.orderCode,
+          return_type: "2",
+          remark: "", //退货备注
+          errorCode: "", //退货原因
+          thnum: send_num + "",
+          returnT: send_num + "",
+          returnAddr: [{ id: addrid, return_num: send_num }],
+        };
+      }
+      this.returnItem = this.resModel;
       this.returnModel = true;
       console.log(addModel);
     },
+    async restSearch() {
+      this.parmValue = {
+        order_type: "",
+        orderCode: "",
+        apply_name: "", //申请人名称
+        cgdNo: "",
+        start: "",
+        end: "",
+        // supplierNo: "",
+        companyNo: "",
+        good_code: "",
+        good_name: "",
+        outCode: "",
+        status: "",
+        company_name: "", //申请人部门
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      };
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      await this.searchList();
+    },
+    async page_size_change(e) {
+      this.parmValue.size = e;
+      this.pageInfo.size = e;
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
+    async page_curr_change(e) {
+      this.parmValue.page = e;
+      this.pageInfo.curr = e;
+      await this.searchList();
+    },
   },
 };
 </script>
-   <style lang="scss" scoped>
-</style>
-   
+<style lang="scss" scoped></style>

+ 5 - 5
src/views/sellOut/salesOrder/components/out-order-add-model.vue

@@ -27,12 +27,12 @@
           >
             <el-row>
               <el-col :span="12">
-                <el-form-item label="未发总数" prop="wsend_num" required>
+                <el-form-item label="无地址数" prop="wsend_num" required>
                   <el-input
                     disabled
                     v-model="ruleForm.wsend_num"
                     maxlength="10"
-                    placeholder="未发总数"
+                    placeholder="无地址数"
                   />
                 </el-form-item>
               </el-col>
@@ -263,11 +263,11 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          const { orderCode, wsend_num } = this.sitem;
+          const { orderCode, addr_sum } = this.sitem;
           this.ruleForm = {
             orderCode: orderCode || "",
-            wsend_num: wsend_num || "0",
-            send_num: wsend_num || "0",
+            wsend_num: addr_sum || "0",
+            send_num: addr_sum || "0",
             contactor: "",
             mobile: "",
             addr: "",

+ 10 - 12
src/views/sellOut/sellOutOrder/columns.js

@@ -42,10 +42,16 @@ const columns = [
     _slot_: "status",
     width: "120px",
   },
-
+  {
+    prop: "order_type",
+    label: "商品来源",
+    _slot_: "order_type",
+    width: "85",
+  },
   {
     prop: "send_num",
-    label: "出库总数",
+    label: "发货数量",
+    width: "80px",
   },
   {
     prop: "good_class",
@@ -79,12 +85,7 @@ const columns = [
   //   width: "200"
   // },
 
-  {
-    prop: "order_type",
-    label: "商品来源",
-    _slot_: "order_type",
-    width: "70",
-  },
+
   {
     prop: "contactor",
     label: "联系人",
@@ -112,10 +113,7 @@ const columns = [
     label: "发货时间",
     width: "140",
   },
-  {
-    prop: "send_num",
-    label: "发货数量",
-  },
+ 
   {
     prop: "addtime",
     label: "添加时间",

+ 13 - 2
src/views/sellOut/sellOutOrder/components/want-deliver.vue

@@ -107,7 +107,7 @@
 <script>
 import asyncRequest from "@/apis/service/sellOut/sellOutOrder";
 import resToken from "@/mixins/resToken";
-import { isnumber, isNumeric } from "@/utils/validate";
+import { isnumber, isNumeric, hasSpace, isSpecialSymbol } from "@/utils/validate";
 // import ladderPriceVue from "@/views/goodStore/goodsCost/ladderPrice.vue";
 export default {
   name: "wsmInOrderAdd",
@@ -145,6 +145,17 @@ export default {
         callback();
       }
     };
+    const validate_remark = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("不能为空!"));
+      } else if (hasSpace(value)) {
+        callback(new Error("不能出现回车/换行符!"));
+      } else if (isSpecialSymbol(value)) {
+        callback(new Error("不能使用英文特殊字符!"));
+      } else {
+        callback();
+      }
+    };
 
     return {
       loading: true,
@@ -187,7 +198,7 @@ export default {
         },
         remark: {
           required: true,
-          validator: validate_num,
+          validator: validate_remark,
           trigger: "blur",
         },
       },

+ 59 - 239
src/views/sellOut/sellReturn/components/addModel.vue

@@ -3,8 +3,8 @@
     :title="'新建退货单'"
     :center="true"
     align="left"
-    top="5vh"
-    width="1040px"
+    top="12vh"
+    width="700px"
     @close="showModelThis = false"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
@@ -24,7 +24,7 @@
         class="demo-ruleForm"
       >
         <el-row>
-          <el-col :span="8">
+          <el-col :span="12">
             <el-form-item label="退货类型" prop="return_type">
               <el-select
                 v-model="ruleForm.return_type"
@@ -42,6 +42,8 @@
                 </el-option>
               </el-select>
             </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="退货原因" prop="errorCode">
               <abnormal-cause
                 :value="ruleForm.errorCode"
@@ -50,8 +52,9 @@
                 :size="'mini'"
                 @searchChange="errorCode_change"
               />
-            </el-form-item> </el-col
-          ><el-col :span="16">
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
             <el-form-item label="退货备注" prop="remark">
               <el-input
                 :disabled="isDetail"
@@ -63,135 +66,21 @@
                 v-model="ruleForm.remark"
               /> </el-form-item
           ></el-col>
-          <el-col :span="24" v-show="ruleForm.return_type === '2'">
-            <el-form-item label="收货信息" :size="'mini'" required>
-              <el-table
-                :data="get_product_go"
-                border
-                :size="'mini'"
-                row-key="key"
-                max-height="300px"
-              >
-                <el-table-column
-                  label="收货人-联系电话-地址"
-                  min-width="300"
-                  show-overflow-tooltip
-                >
-                  <template slot-scope="scope">
-                    {{ scope.row.contactor }}-{{ scope.row.mobile }}-{{
-                      scope.row.addr_info
-                    }}{{ scope.row.addr }}
-                  </template></el-table-column
-                >
-                <el-table-column
-                  label="对应发货申请状态"
-                  prop="send_status"
-                  width="125px"
-                >
-                  <template slot-scope="scope">
-                    <el-tag
-                      :size="'mini'"
-                      :type="scope.row.send_status == '0' ? 'warning' : ''"
-                      v-text="
-                        (
-                          statusOptions.find(
-                            (item) => item.id == scope.row.send_status
-                          ) || {}
-                        ).label || '--'
-                      "
-                    ></el-tag> </template
-                ></el-table-column>
-
-                <el-table-column
-                  label="收货总数量"
-                  prop="receipt_quantity"
-                  width="100"
-                />
 
-                <el-table-column label="退货数量" width="150">
-                  <template slot-scope="scope">
-                    <digital-input
-                      v-show="scope.row.edit"
-                      :values="scope.row.return_num"
-                      :placeholder="'退货数量'"
-                      :min="0"
-                      :disabled="false"
-                      :max="scope.row.receipt_quantity"
-                      :position="'right'"
-                      :precision="0"
-                      :size="'mini'"
-                      :controls="false"
-                      :append="''"
-                      @reschange="
-                        number_change($event, 'return_num', scope.$index)
-                      "
-                    />
-                    <span v-show="!scope.row.edit">
-                      {{ scope.row.return_num }}
-                    </span>
-                  </template>
-                </el-table-column>
-                <el-table-column fixed="right" label="操作" width="50">
-                  <template slot-scope="scope">
-                    <el-tooltip
-                      effect="dark"
-                      content="编辑"
-                      v-if="
-                        !scope.row.edit &&
-                        (scope.row.send_status === '0' ||
-                          scope.row.send_status === '1')
-                      "
-                      placement="top"
-                    >
-                      <i
-                        class="el-icon-edit tb-icon"
-                        @click="editRow(scope.$index, 1)"
-                      ></i>
-                    </el-tooltip>
-
-                    <el-tooltip
-                      effect="dark"
-                      content="保存"
-                      v-if="
-                        scope.row.edit &&
-                        (scope.row.send_status === '0' ||
-                          scope.row.send_status === '1')
-                      "
-                      placement="top"
-                    >
-                      <i
-                        class="el-icon-circle-check tb-icon"
-                        @click="checkRow(scope.$index, 1)"
-                      ></i>
-                    </el-tooltip>
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-form-item>
-          </el-col>
           <el-col :span="24">
             <el-row>
-              <el-col :span="6">
-                <el-form-item label="购买数量" prop="good_num">
+              <el-col :span="8">
+                <el-form-item label="可退数量" prop="good_num">
                   <el-input
                     v-model="ruleForm.good_num"
                     :disabled="true"
-                    placeholder="购买数量"
-                    maxlength="10"
-                  ></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :span="6" v-show="ruleForm.return_type === '1'">
-                <el-form-item label="可退数量" prop="returnT">
-                  <el-input
-                    v-model="ruleForm.returnT"
-                    :disabled="true"
-                    maxlength="10"
                     placeholder="可退数量"
+                    maxlength="10"
                   ></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="6" v-show="ruleForm.return_type === '1'">
+
+              <el-col :span="8">
                 <el-form-item label="退货数量" prop="thnum">
                   <digital-input
                     :values="ruleForm.thnum"
@@ -208,17 +97,11 @@
                   />
                 </el-form-item>
               </el-col>
-              <el-col
-                :span="ruleForm.return_type === '1' ? 6 : 18"
-                style="text-align: right"
-              >
+              <el-col :span="8" style="text-align: right">
                 <el-button type="primary" @click="submitForm" :size="'mini'"
                   >保 存
                 </el-button>
-                <el-button
-                  @click="showModelThis = false"
-                  v-if="!isDetail"
-                  :size="'mini'"
+                <el-button @click="showModelThis = false" v-if="!isDetail" :size="'mini'"
                   >关 闭</el-button
                 >
               </el-col>
@@ -229,7 +112,7 @@
     </el-card>
   </el-dialog>
 </template>
-   <script>
+<script>
 import asyncRequest from "@/apis/service/sellOut/sellReturn";
 import resToken from "@/mixins/resToken";
 import { isnumber } from "@/utils/validate";
@@ -336,19 +219,13 @@ export default {
       await this.resetForm();
       this.loading = false;
     },
-    async number_change(e, key, index) {
-      if (index === undefined) {
-        this.ruleForm[key] = e + "" || "0";
-        this.$refs.ruleForm.validateField(key);
-      } else {
-        this.get_product_go[index][key] = e + "" || "0";
-        this.$set(this.get_product_go, index, this.get_product_go[index]);
-      }
+    async number_change(e, key) {
+      this.ruleForm[key] = e + "" || "0";
+      this.$refs.ruleForm.validateField(key);
     },
     return_type_change() {
       const { return_type } = this.ruleForm;
-      this.ruleForm.returnT =
-        return_type === "1" ? this.noAddrT : this.hasAddrT;
+      this.ruleForm.returnT = return_type === "1" ? this.noAddrT : this.hasAddrT;
     },
     async resetForm() {
       // 重置
@@ -356,51 +233,26 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          const { addrs, orderCode, good_num, send_type, wsend_num } =
-            this.sitem;
-          console.log(this.sitem);
-          console.log(this.type_change);
-          let numed = 0;
-          this.noAddrT = 0;
-          this.hasAddrT = 0;
-          let l_list = [];
-          addrs.forEach((a) => {
-            this.hasAddrT += a.receipt_quantity * 1;
-            l_list.push(a);
-            if (a.send_status === "0" || a.send_status === "1") {
-            } else {
-              numed += a.receipt_quantity * 1;
-            }
-          });
-          l_list.map((b) => {
-            b.edit = false;
-            b.return_num = b.return_num || "0";
-            return b;
-          });
-          this.noAddrT = good_num * 1 - this.hasAddrT;
-          if (this.noAddrT === 0 || this.hasAddrT === 0) {
-            this.type_change = true;
-          } else {
-            this.type_change = false;
-          }
-          let return_type =
-            this.noAddrT !== 0 && this.hasAddrT !== 0
-              ? "1"
-              : this.noAddrT !== 0
-              ? "1"
-              : "2";
-          console.log(this.noAddrT, this.hasAddrT);
+          const {
+            good_num,
+            orderCode,
+            return_type,
+            remark, //退货备注
+            errorCode, //退货原因
+            thnum,
+            returnT,
+            returnAddr,
+          } = this.sitem;
           this.ruleForm = {
-            good_num: good_num || "0",
-            orderCode: orderCode || "",
-            return_type: return_type,
-            remark: "", //退货备注
-            errorCode: "", //退货原因
-            thnum: return_type === "1" ? this.noAddrT : "0" || "0",
-            returnT: "0",
+            good_num,
+            thnum,
+            return_type,
+            orderCode, //发货申请单编号
+            remark, //退货备注
+            errorCode, //退货原因
+            returnT,
+            returnAddr,
           };
-          (this.get_product_go = [].concat(...l_list)),
-            this.return_type_change();
         }
       });
     },
@@ -408,57 +260,27 @@ export default {
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
-          if (this.loading) {
+          if (this.loading) return;
+          this.loading = true;
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          const { good_num, thnum, return_type } = model;
+          if (thnum + "" === "0") {
+            this.$message.warning("退货数量不能为0!");
+            this.loading = false;
             return;
           }
-          this.loading = true;
-          // this.loading = true;
-          const { thnum, return_type, orderCode, remark, errorCode } =
-            this.ruleForm;
-          console.log(this.ruleForm);
-          let model = {
-            orderCode,
-            errorCode,
-            remark,
-            thnum,
-            returnAddr: [],
-          };
-          let addr = [],
-            addr_total = 0;
-
-          if (return_type === "2") {
-            let arr1 = JSON.parse(JSON.stringify(this.get_product_go));
-            let addr_edit = false;
-            arr1.forEach((e) => {
-              if (e.edit) {
-                addr_edit = true;
-              }
-              let obj = {
-                id: e.id,
-                return_num: e.return_num,
-              };
-              addr_total += e.return_num * 1;
-              addr.push(obj);
-            });
-            model.returnAddr = addr;
-
-            if (addr_edit) {
-              this.$message.warning("地址信息正在编辑,请保存后再试!");
-              this.loading = false;
-              return;
-            }
-            if (addr_total === 0) {
-              this.$message.warning("地址退货总数量不能为0!");
-              this.loading = false;
-              return;
-            }
-            console.log(addr_total);
-            model.thnum = addr_total;
+          if (parseInt(good_num + "") < parseInt(thnum + "")) {
+            this.$message.warning("退货数量不能大于可退数量!");
+            this.loading = false;
+            return;
           }
-          console.log(model);
-          let res = await asyncRequest.add(model);
+          if (return_type + "" === "2") {
+            model.returnAddr[0].return_num = thnum;
+          }
+
+          const { code, data, message } = await asyncRequest.add(model);
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             this.$notify.success({
               title: "添加成功",
               message: "",
@@ -466,13 +288,12 @@ export default {
             this.showModelThis = false;
             // 刷新
             this.$emit("refresh", false);
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.message);
+            this.$message.warning(message);
           }
         } else {
-          console.log("error submit!!");
           return false;
         }
       });
@@ -507,6 +328,5 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped>
-</style>
-  /
+<style lang="scss" scoped></style>
+/

+ 4 - 4
src/views/sellOut/sellReturn/detail.vue

@@ -96,25 +96,25 @@
                       <el-table-column
                         label="收货总数量"
                         prop="receipt_quantity"
-                        width="80"
+                        width="110"
                         show-overflow-tooltip
                       />
                       <el-table-column
                         label="未发货数量"
                         prop="addr_wsend"
-                        width="80"
+                        width="110"
                         show-overflow-tooltip
                       />
                       <el-table-column
                         label="已发货数量"
                         prop="addr_send"
-                        width="80"
+                        width="110"
                         show-overflow-tooltip
                       />
                       <el-table-column
                         label="退货数量"
                         prop="return_num"
-                        width="80"
+                        width="110"
                         show-overflow-tooltip
                       />