zhangjinxing 3 years ago
parent
commit
2bb28bb387
26 changed files with 1825 additions and 573 deletions
  1. 1 1
      src/apis/service/purchaseIn/purchaseDiffOrder/index.js
  2. 22 0
      src/apis/service/purchaseIn/purchaseReturn/index.js
  3. 40 34
      src/views/process/done/index.vue
  4. 33 18
      src/views/process/oing/index.vue
  5. 3 0
      src/views/purchaseIn/purchaseDiffOrder/addEditModel.vue
  6. 57 0
      src/views/purchaseIn/purchaseDiffOrder/columns.js
  7. 115 44
      src/views/purchaseIn/purchaseDiffOrder/detail.vue
  8. 40 91
      src/views/purchaseIn/purchaseDiffOrder/index.vue
  9. 17 125
      src/views/purchaseIn/purchaseDiffOrder/purchaseIn-table.vue
  10. 0 1
      src/views/purchaseIn/purchaseOrder/components/purchase-order-addEdit.vue
  11. 0 1
      src/views/purchaseIn/purchaseOrder/components/purchase-order-addedit-model.vue
  12. 341 0
      src/views/purchaseIn/purchaseOrder/components/workDiff-table.vue
  13. 4 1
      src/views/purchaseIn/purchaseOrder/detail.vue
  14. 362 0
      src/views/purchaseIn/purchaseReturn/addEdit.vue
  15. 69 0
      src/views/purchaseIn/purchaseReturn/columns.js
  16. 466 0
      src/views/purchaseIn/purchaseReturn/index.vue
  17. 1 0
      src/views/purchaseIn/wsmInOrder/index.vue
  18. 133 142
      src/views/sellOut/returnOrder/components/return-record.vue
  19. 2 2
      src/views/sellOut/returnOrder/components/returnCheck.vue
  20. 5 3
      src/views/sellOut/salesOrder/components/addForm.vue
  21. 5 2
      src/views/sellOut/salesOrder/components/order-out-table.vue
  22. 15 10
      src/views/sellOut/salesOrder/detail.vue
  23. 17 5
      src/views/sellOut/sellAfterApply/serviceDetail.vue
  24. 38 13
      src/views/sellOut/sellReturnList/detail.vue
  25. 22 80
      src/views/sellOut/sellReturnList/index.vue
  26. 17 0
      text.text

+ 1 - 1
src/apis/service/purchaseIn/purchaseDiffOrder/index.js

@@ -13,6 +13,6 @@ export default {
   // 更新
   update: (data, params) => http(api + "update", data, "post", params),
   // 修改状态
-  status: (data, params) => http(api + "accountstatus", data, "post", params),
+  status: (data, params) => http(api + "cgddiffstatu", data, "post", params),
 };
    

+ 22 - 0
src/apis/service/purchaseIn/purchaseReturn/index.js

@@ -0,0 +1,22 @@
+// 物业管理员
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 添加
+  add: (data, params) => http(api + "backcreate", data, "post", params),
+  // 删除
+  delete: (data, params) => http(api + "delete", data, "post", params),
+  // 分页查询
+  list: (data, params) => http(api + "backlist", data, "post", params),
+  // 详情
+  detail: (data, params) => http(api + "detail", data, "post", params),
+  // 更新
+  update: (data, params) => http(api + "update", data, "post", params),
+  // 修改状态
+  status: (data, params) => http(api + "backstatus", data, "post", params),
+    // 退货物流
+  returnExp: (data, params) => http(api + "backfe", data, "post", params),
+  
+
+};
+   

+ 40 - 34
src/views/process/done/index.vue

@@ -159,9 +159,7 @@ export default {
       isDetail: false,
       modelId: 0,
       parmValue: {
-        loginName: "", // 账户
-        fullName: "", // 姓名
-        type: 2, // 用户类型(1运营人员 2物业人员)
+       
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
@@ -186,23 +184,15 @@ export default {
       },
       // 表格 - 列参数
       columns: [
-        // {
-        //   prop: "order_code",
-        //   label: "订单编号",
-        // },
-        {
-          prop: "order_type",
-          label: "流程类型",
-        },
         {
           prop: "order_code",
           label: "订单编号",
         },
-
         {
-          prop: "order_process",
-          label: "流程节点",
+          prop: "order_type",
+          label: "订单类型",
         },
+
         {
           prop: "apply_name",
           label: "申请人",
@@ -213,6 +203,15 @@ export default {
           // sortable: true,
           // _slot_: "status",
         },
+        {
+          prop: "order_process",
+          label: "状态",
+        },
+        {
+          prop: "addtime",
+          label: "创建时间",
+          width: "150",
+        },
         {
           prop: "",
           label: "操作",
@@ -232,33 +231,43 @@ export default {
       console.log(type, code, id);
       let list = [
         {
-          type: "CGD", //采购单
-          rname: "purchaseOrderDetail",
-          to: "id",
+          type: "CGD", //采购单管理
+          sellR: "/purchaseIn/purchaseOrderDetail",
+          askR: "",
+          to: "code",
         },
         {
-          type: "RKD", //入库单
-          rname: "",
+          type: "BKD", //入库单
+          sellR: "/purchaseIn/storeManageFlow",
+          askR: "",
           to: "id",
         },
         {
-          type: "FKD", //反馈单流程
-          rname: "storeManageFlow",
-          to: "id",
+          type: "RKD", //备货入库单
+          sellR: "/purchaseIn/wsmInOrderDetail",
+          askR: "",
+          to: "code",
         },
+        // {
+        //   type: "FKD", //反馈单流程
+        //   rname: "storeManageFlow",
+        //   to: "id",
+        // },
         {
-          type: "BHD", //备货流程
-          rname: "storeManageFlow",
-          to: "id",
+          type: "BHD", //备货申请管理
+          sellR: "/purchaseIn/storeManageFlow",
+          askR: "",
+          to: "code",
         },
         {
           type: "PDD", //盘点流程
-          rname: "checkDetail",
+          sellR: "/stock/checkDetail",
+          askR: "",
           to: "id",
         },
         {
           type: "DBD", //调拨流程
-          rname: "allotDetail",
+          rname: "/stock/allotDetail",
           to: "id",
         },
         // {
@@ -273,7 +282,8 @@ export default {
         // },
         {
           type: "XSQRD", //销售确认单流程
-          rname: "salesOrderDetail",
+          sellR: "/sellOut/salesOrderDetai",
+          askR: "",
           to: "id",
         },
         // {
@@ -292,9 +302,7 @@ export default {
       });
       console.log(item, "item");
       if (item && item.type) {
-        console.log(this.routeGoto);
-        // this.routeGoto(item.rname, { id: item.to === "id" ? id : code });
-        await this.routeGoto("serviceDetail", { id: "RXSwjeo211119103144" });
+        this.routeGoto(item.sellR, { id: item.to === "id" ? id : code });
       }
     },
     restSearch() {
@@ -305,9 +313,7 @@ export default {
         total: 0,
       };
       this.parmValue = {
-        status: "", // 账户
-        level: "", // 姓名
-        role_name: "",
+       
         page: 1, // 页码
         size: 15, // 每页显示条数
       };

+ 33 - 18
src/views/process/oing/index.vue

@@ -74,7 +74,13 @@
         >
           <i
             class="el-icon-view tb-icon"
-            @click="getRouter(scope.row.order_type, scope.row.order_code)"
+            @click="
+              getRouter(
+                scope.row.order_type,
+                scope.row.order_code,
+                scope.row.order_id
+              )
+            "
           ></i>
         </el-tooltip>
         <el-tooltip
@@ -245,33 +251,43 @@ export default {
       console.log(type, code, id);
       let list = [
         {
-          type: "CGD", //采购单
-          rname: "purchaseOrderDetail",
-          to: "id",
+          type: "CGD", //采购单管理
+          sellR: "/purchaseIn/purchaseOrderDetail",
+          askR: "",
+          to: "code",
         },
         {
-          type: "RKD", //入库单
-          rname: "",
+          type: "BKD", //入库单
+          sellR: "/purchaseIn/storeManageFlow",
+          askR: "",
           to: "id",
         },
         {
-          type: "FKD", //反馈单流程
-          rname: "storeManageFlow",
-          to: "id",
+          type: "RKD", //备货入库单
+          sellR: "/purchaseIn/wsmInOrderDetail",
+          askR: "",
+          to: "code",
         },
+        // {
+        //   type: "FKD", //反馈单流程
+        //   rname: "storeManageFlow",
+        //   to: "id",
+        // },
         {
-          type: "BHD", //备货流程
-          rname: "storeManageFlow",
-          to: "id",
+          type: "BHD", //备货申请管理
+          sellR: "/purchaseIn/storeManageFlow",
+          askR: "",
+          to: "code",
         },
         {
           type: "PDD", //盘点流程
-          rname: "checkDetail",
+          sellR: "/stock/checkDetail",
+          askR: "",
           to: "id",
         },
         {
           type: "DBD", //调拨流程
-          rname: "allotDetail",
+          rname: "/stock/allotDetail",
           to: "id",
         },
         // {
@@ -286,7 +302,8 @@ export default {
         // },
         {
           type: "XSQRD", //销售确认单流程
-          rname: "salesOrderDetail",
+          sellR: "/sellOut/salesOrderDetai",
+          askR: "",
           to: "id",
         },
         // {
@@ -305,9 +322,7 @@ export default {
       });
       console.log(item, "item");
       if (item && item.type) {
-        console.log("1212");
-        console.log(this.routeGoto);
-        this.routeGoto(item.rname, { id: item.to === "id" ? id : code });
+        this.routeGoto(item.sellR, { id: item.to === "id" ? id : code });
       }
     },
 

+ 3 - 0
src/views/purchaseIn/purchaseDiffOrder/addEditModel.vue

@@ -168,6 +168,8 @@ export default {
             cgdNo: cgdNo,
             diff_weight: num,
           };
+          console.log(this.ruleForm);
+          // return;
           let res = await asyncRequest.add(model);
           this.loading = false;
           if (res && res.code === 0) {
@@ -177,6 +179,7 @@ export default {
             });
             this.showModelThis = false;
             // 刷新
+
             this.$emit("refresh");
           } else if (res && res.code >= 100 && res.code <= 104) {
             await this.logout();

+ 57 - 0
src/views/purchaseIn/purchaseDiffOrder/columns.js

@@ -0,0 +1,57 @@
+export default [
+        {
+          prop: "cgdNo",
+          label: "采购单编号",
+          width: "160px",
+        },
+        {
+          prop: "apply_name",
+          label: "申请人",
+          width: "65px",
+        },
+        {
+          prop: "good_code",
+          label: "商品编码",
+          width: "150px",
+        },
+        {
+          prop: "good_name",
+          label: "商品名称",
+        },
+        {
+          prop: "class_cat",
+          label: "商品分类",
+        },
+
+        {
+          prop: "good_weight",
+          label: "商品总重量(g)",
+          width: "110px",
+        },
+        {
+          prop: "diff_weight",
+          label: "工差总重量(g)",
+          width: "110px",
+        },
+
+        {
+          prop: "status",
+          label: "状态",
+          _slot_: "status",
+          width: "120px",
+        },
+        {
+          prop: "addtime",
+          label: "创建时间",
+          width: "140px",
+          sortable: true,
+        },
+        {
+          prop: "",
+          label: "操作",
+          fixed: "right",
+          _noset_: true,
+          width: "52px",
+          _slot_: "operation",
+        },
+      ]

+ 115 - 44
src/views/purchaseIn/purchaseDiffOrder/detail.vue

@@ -4,21 +4,17 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <!-- <div class="detail-page-title">
-        <span class="title">采购单编号:{{ queryId }}</span>
-        <span class="fr">
-          <el-tag>
-            {{
-              (statusList.find((item) => item.code == status) || {}).label ||
-              "--"
-            }}
-          </el-tag>
-        </span>
-      </div> -->
       <p>queryId {{ queryId }} --</p>
+      <p>{{ status }}---</p>
+      <status-bar
+        v-if="newTime !== ''"
+        :newTime="newTime"
+        :options="statusOptions"
+        :status="status"
+      />
       <el-collapse v-model="activeNames">
-        <el-collapse-item title="采购工差单信息" name="1">
-          <add-edit
+        <el-collapse-item title="采购工差单详情" name="1">
+          <purchase-order-addEdit
             style="padding: 0 0 20px 0"
             :newTime="newTime"
             v-if="newTime !== ''"
@@ -27,13 +23,50 @@
             @refresh="initData()"
           />
         </el-collapse-item>
-        <el-collapse-item title="备货入库单" name="2">
-          <purchase-order-in-table
+        <!-- && status === '3' -->
+        <el-collapse-item
+          title="通知采购部门"
+          name="1"
+          v-if="powers.some((item) => item == '038')"
+        >
+          <div
+            style="height: 60px; padding: 20px 0 0px 0"
+            v-if="status === '1'"
+          >
+            <el-button
+              type="info"
+              class="fr"
+              size="mini"
+              @click="statusConfirm('2', '确定我已知晓并同意')"
+              >我已知晓</el-button
+            >
+          </div>
+        </el-collapse-item>
+        <!-- && status === '4' -->
+        <el-collapse-item
+          title="通知财务部门"
+          name="1"
+          v-if="powers.some((item) => item == '039')"
+        >
+          <div
+            style="height: 60px; padding: 20px 0 0px 0"
+            v-if="status === '2'"
+          >
+            <el-button
+              type="info"
+              class="fr"
+              size="mini"
+              @click="statusConfirm('3', '确定我已知晓并同意')"
+              >我已知晓</el-button
+            >
+          </div>
+        </el-collapse-item>
+        <el-collapse-item title="审批记录" name="10">
+          <process-time-line
+            v-if="newTime !== ''"
             :newTime="newTime"
-            v-if="newTime !== '' && status !== '' && status !== '0'"
-            :sitem="sitem"
-            :id="queryId"
-            @refresh="initData()"
+            :type="type"
+            :orderCode="orderCode"
           />
         </el-collapse-item>
       </el-collapse>
@@ -49,12 +82,15 @@ import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/purchaseIn/purchaseDiffOrder";
 import addEdit from "./addEdit";
 import PurchaseInTable from "./purchaseIn-table.vue";
+import purchaseOrderAddEdit from "./purchaseIn-table";
+
 export default {
   name: "purchaseDiffOrderDetail",
   mixins: [mixinPage, resToken],
   components: {
     addEdit,
     PurchaseInTable,
+    purchaseOrderAddEdit,
   },
   computed: {
     powers() {
@@ -69,36 +105,24 @@ export default {
       }
     },
   },
-  mounted() {
-    console.log(this.$route);
-  },
   data() {
     return {
+      statusOptions: [
+        { value: "1", label: "通知采购部门" },
+        { value: "2", label: "通知财务部门" },
+        { value: "3", label: "工差单审核完成" },
+      ],
       finishStatus: "finish",
-      activeNames: ["0", "1", "2", "3", "4", "5"],
+      activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
       sitem: null,
-      statusList: [
-        {
-          code: "0",
-          label: "待同意发货",
-        },
-        {
-          code: "1",
-          label: "待发货",
-        },
-        {
-          code: "2",
-          label: "部分发货",
-        },
-        {
-          code: "3",
-          label: "发货完成",
-        },
-      ],
       status: "",
       newTime: "",
       loading: false,
       queryId: "",
+      orderCode: "", //审批记录的code
+      rid: "", //状态接口中需要的id字段
+      order_type: "", //用于判断订单是备库单还是咨询单
+      type:"",//审批记录
     };
   },
   mounted() {
@@ -106,6 +130,45 @@ export default {
     this.initData();
   },
   methods: {
+    async statusConfirm(status, message, remark) {
+      await this.$confirm(`确定要${message}?`, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          if (status === "-1") {
+            await this.delete(message);
+          } else {
+            console.log(status, message, remark);
+            await this.setstatus(status, message, remark);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    async setstatus(status, message, remark = "") {
+      console.log(status, "status", remark, "remark");
+      let _model = {
+        id: this.rid,
+        status: status,
+      };
+      console.log(_model);
+      let res = await asyncRequest.status(_model);
+      if (res && res.code === 0) {
+        this.$notify.success({
+          title: "修改成功!",
+          message: "",
+        });
+        await this.initData();
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+
     getNewTime() {
       this.newTime = new Date().valueOf();
     },
@@ -120,10 +183,20 @@ export default {
       this.loading = true;
       const res = await asyncRequest.detail({ id: this.queryId });
       if (res && res.code === 0 && res.data) {
-
         this.sitem = res.data;
         this.status = this.sitem.status;
+        this.orderCode = res.data.cgdNo;
+        this.rid = res.data.id;
         this.getNewTime();
+        if (this.order_type === "2") {
+          this.order_type = res.data.cgdNo;
+          console.log(this.statusOptions);
+          this.statusOptions.unshift({ value: "0", label: "咨询单" });
+        }
+        this.order_type === '1' ? "CGGCD" : "ZXGCD";
+        this.order_type = res.data.order_type;
+
+        console.log(this.rid);
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {
@@ -135,8 +208,6 @@ export default {
 };
 </script>
    <style lang="scss" scoped>
-.purchaseDiffOrderDetail {
-}
 </style>
    
    

+ 40 - 91
src/views/purchaseIn/purchaseDiffOrder/index.vue

@@ -59,7 +59,30 @@
                     @timeReturned="handleTime"
                   />
                 </el-col>
-
+                <el-col :span="6" style="width: 400px; padding: 0 0 0 10px">
+                  <el-input
+                    clearable
+                    placeholder="请选择"
+                    v-model="s_input"
+                    :size="searchSize"
+                    class="input-with-select"
+                  >
+                    <el-select
+                      v-model="select"
+                      style="width: 125px"
+                      slot="prepend"
+                      placeholder="请选择"
+                    >
+                      <el-option label="采购单编号" value="cgdNo"></el-option>
+                      <el-option label="申请人" value="apply_name"></el-option>
+                    </el-select>
+                    <el-button
+                      slot="append"
+                      icon="el-icon-search"
+                      @click="handleValue"
+                    ></el-button>
+                  </el-input>
+                </el-col>
                 <el-col :span="3" style="width: 66px; float: right">
                   <el-button
                     :size="searchSize"
@@ -82,34 +105,7 @@
                 </el-col>
               </el-col>
             </el-row>
-            <el-row style="padding:10px 0 0 0">
-              <el-col :span="4" style="width: 320px">
-                <el-input
-                  :size="searchSize"
-                  v-model="parmValue.cgdNo"
-                  :maxlength="40"
-                  @blur="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                  placeholder="采购单编号"
-                />
-              </el-col>
-              <el-col :span="4" style="width: 180px; padding: 0 0 0 10px">
-                <el-input
-                  :size="searchSize"
-                  v-model="parmValue.apply_name"
-                  :maxlength="40"
-                  placeholder="申请人"
-                  @blur="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                />
-              </el-col>
-            </el-row>
+            <el-row style="padding: 10px 0 0 0"> </el-row>
           </div>
         </template>
         <template #status="{ scope }">
@@ -157,6 +153,7 @@ import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/purchaseIn/purchaseDiffOrder";
 // import addEditModel from "./addEditModel";
+import columns from "./columns";
 import { mapGetters } from "vuex";
 
 export default {
@@ -182,11 +179,11 @@ export default {
   data() {
     return {
       sitem: null,
-      select: "1",
-      input: "",
+      select: "cgdNo",
+      s_input: "", //下拉搜索框内容
       // 状态
       statusOptions: [
-        { id: "0", label: "待发起审核" },
+        // { id: "0", label: "待通知采购部门" },
         { id: "1", label: "待通知采购部门" },
         { id: "2", label: "待通知财务部门" },
         { id: "3", label: "已完成" },
@@ -198,7 +195,9 @@ export default {
       parmValue: {
         name: "", // 业务员名字
         username: "", // 账号
-        status: "", //
+        apply_name: "", //申请人
+        cgdNo: "", //采购单编号
+        status: "", //工差单状态
         start: "", //
         end: "",
         page: 1, // 页码
@@ -223,63 +222,7 @@ export default {
         total: 0,
       },
       // 表格 - 列参数
-      columns: [
-        {
-          prop: "cgdNo",
-          label: "采购单编号",
-          width: "160px",
-        },
-        {
-          prop: "apply_name",
-          label: "申请人",
-          width: "65px",
-        },
-        {
-          prop: "good_code",
-          label: "商品编码",
-          width: "150px",
-        },
-        {
-          prop: "good_name",
-          label: "商品名称",
-        },
-          {
-          prop: "class_cat",
-          label: "商品分类",
-        },
-        
-        {
-          prop: "good_weight",
-          label: "商品总重量(g)",
-          width: "110px",
-        },
-        {
-          prop: "diff_weight",
-          label: "工差总重量(g)",
-          width: "110px",
-        },
-
-        {
-          prop: "status",
-          label: "状态",
-          _slot_: "status",
-          width: "120px",
-        },
-        {
-          prop: "addtime",
-          label: "创建时间",
-          width: "140px",
-          sortable: true,
-        },
-        {
-          prop: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          width: "52px",
-          _slot_: "operation",
-        },
-      ],
+      columns: columns,
     };
   },
   mounted() {
@@ -359,7 +302,7 @@ export default {
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
-           this.tableData.forEach((v) => {
+        this.tableData.forEach((v) => {
           v.class_cat = "";
           if (v.can && v.can.length > 0) {
             v.can.forEach((x, i) => {
@@ -408,6 +351,12 @@ export default {
           console.log("取消");
         });
     },
+    async handleValue() {
+      this.parmValue.cgdNo = this.select === "cgdNo" ? this.s_input : "";
+      this.parmValue.apply_name =
+        this.select === "apply_name" ? this.s_input : "";
+      await this.searchList();
+    },
   },
 };
 </script>

+ 17 - 125
src/views/purchaseIn/purchaseDiffOrder/purchaseIn-table.vue

@@ -1,43 +1,5 @@
 <template>
   <div>
-    <div class="tr">
-      <el-button
-        type="primary"
-        :size="'mini'"
-        @click="addForm"
-        v-if="status === '0' && powers.some((item) => item == '007')"
-        >修改
-      </el-button>
-      <el-button
-        type="primary"
-        plain
-        :size="'mini'"
-        @click="statusConfirm('1', '开始发货')"
-        v-if="status === '0' && powers.some((item) => item == '026')"
-        >开始发货
-      </el-button>
-
-      <el-button
-        @click="statusConfirm('0', '取消发货')"
-        plain
-        :size="'mini'"
-        v-if="status === '1' && powers.some((item) => item == '027')"
-        >取消发货</el-button
-      >
-      <el-button
-        @click="statusConfirm('-1', '作废该条信息')"
-        type="danger"
-        plain
-        :size="'mini'"
-        v-if="
-          status !== '' &&
-          status !== '5' &&
-          powers.some((item) => item == '015')
-        "
-        >作废该条信息</el-button
-      >
-    </div>
-
     <el-row class="purchaseOrderDetail-addForm">
       <el-col
         :span="12"
@@ -49,30 +11,30 @@
         <div class="name">{{ sitem[colu.prop] }}</div>
       </el-col>
     </el-row>
-    <purchase-order-addedit-model
+    <!-- <purchase-order-addedit-model
       :id="modelId"
       :show-model="showModel"
       :sitem="detailSitem"
       @refresh="refresh"
       @cancel="showModel = false"
-    />
+    /> -->
   </div>
 </template>
    <script>
-import asyncRequest from "@/apis/service/purchaseIn/purchaseOrder/detail";
+// import asyncRequest from "@/apis/service/purchaseIn/purchaseOrder/detail";
 import resToken from "@/mixins/resToken";
 // import purchaseOrderAddeditModel from "./purchase-order-addedit-model";
-// import columns from "./columns";
+import columns from "./columns";
 export default {
-  name: "addEdit",
+  name: "purchaseDiffOrderDetail",
   props: ["id", "sitem", "newTime"],
   mixins: [resToken],
-  components: { purchaseOrderAddeditModel },
+  // components: { purchaseOrderAddeditModel },
   computed: {
     powers() {
       let tran =
         this.$store.getters.btnList.find(
-          (item) => item.menu_route == "purchaseOrderDetail"
+          (item) => item.menu_route == "purchaseDiffOrderDetail"
         ) || {};
       if (tran && tran.action && tran.action.length > 0) {
         return tran.action;
@@ -97,16 +59,16 @@ export default {
       modelId: 0,
     };
   },
-  created() {
-    this.initForm();
-  },
-  watch: {
-    newTime: function (val) {
-      if (val) {
-        this.initForm();
-      }
-    },
-  },
+  // created() {
+  //   this.initForm();
+  // },
+  // watch: {
+  //   newTime: function (val) {
+  //     if (val) {
+  //       this.initForm();
+  //     }
+  //   },
+  // },
   methods: {
     closeModel() {
       console.log("closeModel!!");
@@ -116,80 +78,10 @@ export default {
       this.modelId = this.id;
       this.showModel = true;
     },
-
-    async initForm() {
-      this.loading = true;
-      if (this.id === "add") {
-        this.status = "";
-      } else {
-        const { status, can } = this.sitem;
-        this.sitem.goods_class = "";
-        this.status = status || "";
-        can.forEach((v, i) => {
-          this.sitem.goods_class += i === 0 ? v.name : "/" + v.name;
-        });
-      }
-      this.loading = false;
-    },
     refresh() {
       this.showModelThis = false;
       this.$emit("refresh");
     },
-
-    async statusConfirm(status, message) {
-      await this.$confirm(`确定要${message}?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          if (status === "-1") {
-            await this.deleteById(message);
-          } else {
-            await this.setStatus(status, message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-
-    async deleteById(message) {
-      const res = await asyncRequest.delete({ id: this.queryId });
-      if (res && res.code === 0) {
-        this.$notify.success({
-          title: message + "成功!",
-          message: "",
-        });
-
-        this.routeGoto("check", {});
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(res.message);
-      }
-    },
-
-    async setStatus(status, message, remark) {
-      let model = {
-        cgdNo: this.sitem.cgdNo,
-        remark: remark || "",
-        status: status,
-      };
-      const res = await asyncRequest.status(model);
-      this.loading = false;
-      if (res && res.code === 0) {
-        this.$notify.success({
-          title: message + "成功!",
-          message: "",
-        });
-        this.refresh();
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(res.message);
-      }
-    },
   },
 };
 </script>

+ 0 - 1
src/views/purchaseIn/purchaseOrder/components/purchase-order-addEdit.vue

@@ -16,7 +16,6 @@
         v-if="status === '0' && powers.some((item) => item == '026')"
         >开始发货
       </el-button>
-
       <el-button
         @click="statusConfirm('0', '取消发货')"
         plain

+ 0 - 1
src/views/purchaseIn/purchaseOrder/components/purchase-order-addedit-model.vue

@@ -385,7 +385,6 @@ export default {
           item.supplierNo = item.supplierNo.toString();
 
           console.log(item);
-
           const res = await asyncRequest.update(item);
           this.loading = false;
           if (res && res.code === 0) {

+ 341 - 0
src/views/purchaseIn/purchaseOrder/components/workDiff-table.vue

@@ -0,0 +1,341 @@
+<template>
+  <div class="work-diff-table">
+    <el-table
+      ref="addrForm"
+      :data="tableData"
+      border
+      :size="'mini'"
+      style="width: 100%"
+      row-key="key"
+    >
+      <el-table-column
+        show-overflow-tooltip
+        prop="orderCode"
+        label="采购单编号"
+        width="150"
+      />
+
+      <el-table-column
+        show-overflow-tooltip
+        prop="outCode"
+        label="商品分类"
+        width="150"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="apply_name"
+        label="商品名称"
+        width="85"
+      />
+
+      <el-table-column
+        show-overflow-tooltip
+        prop="post_name"
+        label="物流公司"
+        width="110"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="post_code"
+        label="物流单号"
+        width="160"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="post_fee"
+        label="预计物流费"
+        width="100"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="status"
+        label="状态"
+        width="80"
+      >
+        <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="sendtime"
+        label="发货时间"
+        min-width="170"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="send_num"
+        label="	发货数量"
+        width="80"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="check_num"
+        label="验收数量"
+        width="80"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="addr_info"
+        label="省市区"
+        min-width="170"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="addr"
+        label="收货地址"
+        min-width="170"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="contact"
+        label="联系人"
+        width="80"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="mobile"
+        label="联系电话"
+        width="110"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="wsm_supplier"
+        label="供应商"
+        min-width="220"
+      />
+      <el-table-column
+        show-overflow-tooltip
+        prop="wsm_supplierNo"
+        label="仓库供应商"
+        min-width="170"
+      />
+
+      <!-- v-if="status === '0' && powers.some((item) => item == '005')" -->
+      <el-table-column fixed="right" width="80">
+        <template slot="header" slot-scope="scope">
+          <span>操作</span>
+        </template>
+
+        <template slot-scope="scope">
+          <el-tooltip
+            effect="dark"
+            content="查看"
+            v-if="!scope.row.edit"
+            placement="top"
+          >
+            <i
+              class="el-icon-view tb-icon"
+              @click="openHouseModal(scope.$index)"
+            ></i>
+          </el-tooltip>
+          <!-- v-if="sitem.status == '5'" -->
+          <el-tooltip
+            class="fr"
+            effect="dark"
+            content="新建售后申请"
+            placement="top"
+          >
+            <i
+              class="el-icon-plus tb-icon"
+              @click="openModal('add', scope.row)"
+            ></i>
+          </el-tooltip>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+   <script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
+// import outOrderAddModel from "./out-order-add-model";
+// import addEdit from "@/views/sellOut/sellAfterApply/components/addEdit.vue";
+
+import { mapGetters } from "vuex";
+
+export default {
+  name: "workDdiffTable",
+  mixins: [mixinPage, resToken],
+  props: ["newTime", "id", "sitem"],
+  //   components: { addEdit, outOrderAddModel },
+  watch: {
+    newTime: function (val) {
+      if (val) {
+        this.initForm();
+      }
+    },
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "workDdiffTable"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+
+  data() {
+    return {
+      orderCode: "",
+      outCode: "",
+      // 状态
+      statusOptions: [
+        { id: "1", label: "已出库" },
+        { id: "2", label: "验收中" },
+        { id: "3", label: "验收完成" },
+      ],
+      showGoodsModel: false,
+      stock_code: "",
+      tableData: [],
+      loading: false,
+      queryId: "",
+      status: "",
+      showModel: null,
+      modelId: "",
+      modelItem: null,
+      s_sitem: null,
+    };
+  },
+  mounted() {
+    console.log(this.sitem.bum);
+    this.initForm();
+  },
+  methods: {
+    refresh() {
+      this.$emit("refresh");
+    },
+    async initForm() {
+      // console.log("12");
+      this.status = "";
+      this.queryId = this.$route.query.id;
+      // this.rulesThis = this.rules;
+      this.resetForm();
+    },
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        // console.log(this.$refs.addrForm);
+        // if (this.$refs.addrForm) {
+        //   this.$refs.addrForm.resetFields();
+        //   this.$refs.addrForm.clearValidate();
+        const { bum } = this.sitem;
+        this.tableData = bum;
+        // }
+      });
+    },
+
+    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;
+      }
+    },
+    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;
+        }
+      }
+    },
+
+    openHouseModal() {
+      this.modelId = "add";
+      this.modelItem = this.sitem;
+      this.modelShowModel = true;
+    },
+
+    //省市区保存某一行
+    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) {
+          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;
+        }
+      });
+    },
+    openModal(code, sitem, outcode) {
+      console.log(sitem);
+      this.s_sitem = sitem;
+      this.modelId = code;
+      this.showModel = true;
+    },
+  },
+};
+</script>
+   <style lang="scss" scoped>
+</style>
+   

+ 4 - 1
src/views/purchaseIn/purchaseOrder/detail.vue

@@ -42,6 +42,8 @@
             :id="queryId"
             @refresh="initData()"
           />
+          <!-- 工差单表格 -->
+          <work-diff-table ></work-diff-table>
         </el-collapse-item>
         <el-collapse-item title="备货入库单" name="2">
           <purchase-order-in-table
@@ -81,7 +83,7 @@ import asyncRequest from "@/apis/service/purchaseIn/purchaseOrder/detail";
 import purchaseOrderAddEdit from "./components/purchase-order-addEdit";
 import purchaseOrderInTable from "./components/purchase-order-in-table";
 import diffOrderAdd from "@/views/purchaseIn/purchaseDiffOrder/addEditModel";
-
+import WorkDiffTable from "./components/workDiff-table.vue";
 export default {
   name: "purchaseOrderDetail",
   mixins: [mixinPage, resToken],
@@ -89,6 +91,7 @@ export default {
     purchaseOrderAddEdit,
     purchaseOrderInTable,
     diffOrderAdd,
+    WorkDiffTable,
   },
   computed: {
     powers() {

+ 362 - 0
src/views/purchaseIn/purchaseReturn/addEdit.vue

@@ -0,0 +1,362 @@
+<template>
+  <el-dialog
+    :title="title"
+    :center="true"
+    align="left"
+    top="5vh"
+    width="1040px"
+    @close="closeModel"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    v-loading="loading"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+  >
+    <el-card>
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            :model="ruleForm"
+            status-icon
+            :rules="rulesThis"
+            ref="ruleForm"
+            label-width="110px"
+            class="demo-ruleForm"
+          >
+            <el-form-item
+              label="登录名"
+              prop="loginName"
+              v-if="id === 'add' || isDetail"
+            >
+              <el-input
+                v-model="ruleForm.loginName"
+                :disabled="isDetail"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="姓名" prop="fullName">
+              <el-input
+                v-model="ruleForm.fullName"
+                :disabled="isDetail"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="手机号" prop="tel">
+              <el-input v-model="ruleForm.tel" :disabled="isDetail"></el-input>
+            </el-form-item>
+            <el-form-item label="密码" prop="password" v-if="id === 'add'">
+              <el-input
+                type="password"
+                placeholder="密码"
+                :maxlength="20"
+                v-model="ruleForm.password"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="确认密码" prop="password2" v-if="id === 'add'">
+              <el-input
+                type="password"
+                placeholder="再次输入密码"
+                :maxlength="20"
+                v-model="ruleForm.password2"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </el-col>
+        <el-col :span="24" style="text-align: right;">
+          <el-button type="primary" @click="submitForm" v-if="!isDetail"
+            >保 存
+          </el-button>
+          <el-button @click="showModelThis = false">{{ isDetail ? "关 闭" : "取 消" }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+   </template>
+   <script>
+   import asyncRequest from "@/apis/service/purchaseIn/purchaseReturn";
+   import resToken from "@/mixins/resToken";
+   import {
+    isnumber,
+    isMobile,
+    validEmail,
+    isAlphanumeric,
+    isChinese,
+    isEmoticon,
+    validAlphabets,
+  } from "@/utils/validate";
+   export default {
+    name: 'purchaseReturn',
+    props: ["showModel", "id", "isDetail","sitem"],
+    mixins: [resToken],
+    data() {
+      const validateusername = (rule, value, callback) => {
+        if (value === "") {
+          callback(new Error("账号不能为空!"));
+        } else {
+          if (value.length < 6 || value.length > 18) {
+            callback(new Error("账号规则为6~18位数字与字母组合!"));
+          } else {
+            if (isnumber(value)) {
+              callback(new Error("账号规则为6~18位数字与字母组合!"));
+            } else if (validAlphabets(value)) {
+              callback(new Error("账号规则为6~18位数字与字母组合!"));
+            } else if (!isAlphanumeric(value)) {
+              callback(new Error("账号规则为6~18位数字与字母组合!"));
+            } else {
+              callback();
+            }
+          }
+        }
+      };
+      const validatename = (rule, value, callback) => {
+        if (value === "") {
+          callback(new Error("真实姓名不能为空!"));
+        } else {
+          if (value.length < 2 || value.length > 12) {
+            callback(new Error("真实姓名规则为2~12位汉字!"));
+          } else {
+            if (!isChinese(value)) {
+              console.log(9999);
+              callback(new Error("真实姓名规则为2~12位汉字!"));
+            } else if (isEmoticon(value)) {
+              console.log(2345);
+              callback(new Error("真实姓名规则为2~12位汉字!"));
+            } else {
+              callback();
+            }
+          }
+        }
+      };
+      const validatemobile = (rule, value, callback) => {
+        if (value === "") {
+          callback(new Error("手机号不能为空!"));
+        } else {
+          if (!isMobile(value)) {
+            callback(new Error("手机号格式不正确!"));
+          } else {
+            callback();
+          }
+        }
+      };
+  
+      const validateEmail = (rule, value, callback) => {
+        if (value === "") {
+          callback();
+        } else {
+          if (!validEmail(value)) {
+            callback(new Error("邮箱格式不正确!"));
+          } else {
+            callback();
+          }
+        }
+      };
+      return {
+        loading: false,
+        title: "添加账号",
+        showModelThis: this.showModel,
+        ruleForm: {
+          username: "", // 账号
+          name: "", // 真实姓名
+          mobile: "",
+          email: "",
+          role_id: "",
+          status: "1",
+          item: [],
+        },
+        rulesThis: this.rules,
+        rules: {
+          name: [
+            {
+              required: true,
+              validator: validatename,
+              trigger: "blur",
+            },
+          ],
+          username: [
+            {
+              required: true,
+              validator: validateusername,
+              trigger: "blur",
+            },
+          ],
+          mobile: [
+            {
+              required: true,
+              validator: validatemobile,
+              trigger: "blur",
+            },
+          ],
+          email: [
+            {
+              required: false,
+              validator: validateEmail,
+              trigger: "blur",
+            },
+          ],
+          role_id: [
+            {
+              required: true,
+              message: "请选择角色",
+              trigger: "change",
+            },
+          ],
+          item: [
+            {
+              type: "array",
+              required: true,
+              message: "请选择所在部门",
+              trigger: "change",
+            },
+          ],
+          status: [
+            {
+              required: true,
+              message: "请选择状态",
+              trigger: "change",
+            },
+          ],
+        }
+      };
+    },
+    watch: {
+      showModel: function(val) {
+        this.showModelThis = val;
+        if (val) {
+          this.initForm();
+        }
+      },
+      showModelThis(val) {
+        if (!val) {
+          this.$emit("cancel");
+        }
+      }
+    },
+    methods: {
+      closeModel() {
+        console.log("closeModel!!");
+      },
+      async initForm() {
+        this.loading = true;
+        // await this.getRole();
+        if (this.id === "add") {
+          this.title = "添加账号";
+          this.rulesThis = this.rules;
+          await this.resetForm();
+        } else {
+          if (this.isDetail) {
+            this.title = "账号详情";
+            this.rulesThis = {};
+          } else {
+            this.title = "修改账号";
+            this.rulesThis = this.rules;
+          }
+          await this.resetForm(this.sitem);
+          // await this.initData()
+        }
+        this.loading = false;
+      },
+      // async getRole() {
+      //   const model = {
+      //     status: "", // 状态
+      //     level: "", // 姓名
+      //     role_name: "",
+      //   };
+      //   const res = await asyncRequest.getRole(model);
+      //   if (res && res.code === 0 && res.data) {
+      //     this.roleList = res.data;
+      //     this.roleList.map((v1) => {
+      //       v1.id += "";
+      //       v1.status += "";
+      //       return v1;
+      //     });
+      //   }
+      // },
+      async initData() {
+        const res = await asyncRequest.detail({ id: this.id });
+      if (res && res.code === 0 && res.data) {
+        this.ruleForm = res.data;
+        this.ruleForm.role_id = this.ruleForm.role;
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+      },
+      async resetForm(sitem) {
+        // 重置
+        await this.$nextTick(() => {
+          if (this.$refs.ruleForm) {
+            this.$refs.ruleForm.resetFields();
+            this.$refs.ruleForm.clearValidate();
+            const { username, nickname, mobile, email, roleid, status, item } =
+              sitem;
+            this.ruleForm = {
+              username: username || "", // 账号
+              name: nickname || "", // 真实姓名
+              mobile: mobile || "",
+              email: email || "",
+              role_id: roleid || "",
+              status: status || "",
+              item: item || [],
+            };
+            if (this.id === "add" || this.isDetail) {
+              this.rules.username[0].required = false;
+            }
+          }
+        });
+      },
+    
+      async submitForm() {
+        await this.$refs.ruleForm.validate(async (valid) => {
+          if (valid) {
+            this.loading = true;
+            const { username, name, mobile, email, role_id, status } = JSON.parse(
+              JSON.stringify(this.ruleForm)
+            );
+            const model = {
+              id: this.id,
+              username: username || "", // 账号
+              nickname: name || "", // 真实姓名
+              mobile: mobile || "",
+              email: email || "",
+              role: role_id || "",
+              status: status || "",
+            };
+            let res = {};
+            if (this.id === "add") {
+              delete model["id"];
+              res = await asyncRequest.add(model);
+            } else {
+              res = await asyncRequest.update(model);
+            }
+            this.loading = false;
+            if (res && res.code === 0) {
+              const title = this.id === "add" ? "添加成功" : "修改成功";
+              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;
+          }
+        });
+      },
+    },
+ 
+  };
+  </script>
+
+   <style lang="scss" scoped>
+   .purchaseReturn {
+    
+   }
+   </style>
+   

+ 69 - 0
src/views/purchaseIn/purchaseReturn/columns.js

@@ -0,0 +1,69 @@
+export default [
+        {
+          prop: "orderCode",
+          label: "采购订单编号",
+          width:"160"
+        },
+        {
+          prop: "returnCode",
+          label: "退货单编号",
+          width:"160"
+        },
+        // {确认单编号}
+        // {order_type类型}
+        {
+          prop:"good_code",
+          label:"商品属性编码",
+          width:"140"
+        },
+        {
+          prop:"good_name",
+          label:"商品名称",
+          width:"150"
+        },
+        {
+          prop: "num",
+          label: "退货数量",
+        },
+        {
+          prop: "total_num",
+          label: "订单总数",
+        },
+        {
+          prop: "error_msg",
+          label: "退货原因",
+          width:"160"
+        },
+        {
+            prop:"apply_name",
+            label:"申请人",
+        },
+
+        
+        
+        {
+          prop: "return_total",
+          label: "退货总金额",
+          width:"120"
+        },
+        {
+          prop: "status",
+          label: "状态",
+          _slot_: "status",
+          width: "120px",
+        },
+        {
+          prop: "addtime",
+          label: "申请时间",
+          sortable: true,
+          width:150
+        },
+        {
+          prop: "",
+          label: "操作",
+          fixed: "right",
+          _noset_: true,
+          _slot_: "operation",
+        },
+      
+]

+ 466 - 0
src/views/purchaseIn/purchaseReturn/index.vue

@@ -0,0 +1,466 @@
+<template>
+  <div class="purchaseReturn pagePadding">
+    <div
+      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
+    >
+      <!-- loading -->
+      powers:{{ powers }}
+      <ex-table
+        v-loading="false"
+        :table="table"
+        :data="tableData"
+        :columns="columns"
+        :page="pageInfo"
+        :size="size"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @screen-reset="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+        @screen-submit="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+      >
+        <template #table-header="{}">
+          <div style="width: 100%">
+            <el-row style="padding: 0 0 0 80px">
+              <el-col :span="24">
+                <!-- 时间区间 -->
+                <el-col :span="6" style="width: 303px; padding: 0 0 0 0px">
+                  <period-date-picker
+                    :type="1"
+                    :width="'135px'"
+                    :size="searchSize"
+                    :start="parmValue.start"
+                    :end="parmValue.end"
+                    @timeReturned="handleTime"
+                  />
+                </el-col>
+                <el-col :span="4" style="width: 150px; padding: 0 0 0 0px">
+                  <el-select
+                    :size="searchSize"
+                    v-model="parmValue.status"
+                    filterable
+                    clearable
+                    placeholder="退货单状态"
+                    style="width: 100%"
+                    @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  >
+                    <el-option
+                      v-for="item in statusOptions"
+                      :key="'status' + item.id"
+                      :label="item.label"
+                      :value="item.id"
+                    />
+                  </el-select>
+                </el-col>
+                <el-col :span="6" style="width: 400px; padding: 0 0 0 10px">
+                  <el-input
+                    clearable
+                    placeholder="请选择"
+                    v-model="s_input"
+                    :size="searchSize"
+                    class="input-with-select"
+                  >
+                    <el-select
+                      v-model="select"
+                      style="width: 125px"
+                      slot="prepend"
+                      placeholder="请选择"
+                    >
+                      <el-option
+                        label="退货单编号"
+                        value="returnCode"
+                      ></el-option>
+                      <el-option
+                        label="采购订单编号"
+                        value="orderCode"
+                      ></el-option>
+                      <el-option label="申请人" value="apply_name"></el-option>
+                    </el-select>
+                    <el-button
+                      slot="append"
+                      icon="el-icon-search"
+                      @click="handleValue"
+                    ></el-button>
+                  </el-input>
+                </el-col>
+                <el-col
+                  :span="3"
+                  style="width: 66px; float: right"
+                  v-if="powers.some((item) => item == '003')"
+                >
+                  <el-button
+                    @click="openModal('add', false, {})"
+                    :size="searchSize"
+                    type="success"
+                    style="float: right; margin-left: 5px"
+                  >
+                    添加
+                  </el-button>
+                </el-col>
+                <el-col
+                  :span="4"
+                  class="fr"
+                  style="width: 66px; padding: 0 0 0 10px"
+                >
+                  <el-button
+                    type="warning"
+                    class="fr"
+                    :size="searchSize"
+                    @click="restSearch"
+                  >
+                    重置
+                  </el-button>
+                </el-col>
+                <el-col :span="3" style="width: 66px; float: right">
+                  <el-button
+                    :size="searchSize"
+                    type="primary"
+                    style="float: right; margin-left: 5px"
+                    @click="searchList"
+                  >
+                    刷新
+                  </el-button>
+                </el-col>
+              </el-col>
+            </el-row>
+            <el-row style="padding: 10px 0 0 0"> </el-row>
+          </div>
+        </template>
+        <template #status="{ 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>
+        <template #operation="{ scope }">
+          <el-tooltip
+            v-if="powers.some((item) => item == '002')"
+            effect="dark"
+            content="重置密码"
+            placement="top"
+          >
+            <i
+              class="el-icon-refresh-left tb-icon"
+              @click="openPasswordModal(scope.row.id, false)"
+            ></i>
+          </el-tooltip>
+
+          <el-tooltip
+            v-if="powers.some((item) => item == '007')"
+            effect="dark"
+            content="详情"
+            placement="top"
+          >
+            <i
+              class="el-icon-view tb-icon"
+              @click="routeGoto('noSendDetail', { id: scope.row.returnCode })"
+            ></i>
+            <!-- @click="openModal(scope.row.id, true, scope.row)" -->
+          </el-tooltip>
+          <el-tooltip
+            v-if="powers.some((item) => item == '005')"
+            effect="dark"
+            content="修改"
+            placement="top"
+          >
+            <i
+              class="el-icon-edit tb-icon"
+              @click="openModal(scope.row.id, false, scope.row)"
+            ></i>
+          </el-tooltip>
+          <el-tooltip
+            v-if="
+              powers.some((item) => item == '004') && scope.row.status === '1'
+            "
+            effect="dark"
+            content="禁用"
+            placement="top"
+          >
+            <i
+              class="el-icon-video-pause tb-icon"
+              @click="statusConfirm(scope.row.id, scope.row.status)"
+            ></i>
+          </el-tooltip>
+          <el-tooltip
+            v-if="
+              powers.some((item) => item == '004') && scope.row.status === '0'
+            "
+            effect="dark"
+            content="启用"
+            placement="top"
+          >
+            <i
+              class="el-icon-video-play tb-icon"
+              @click="statusConfirm(scope.row.id, scope.row.status)"
+            ></i>
+          </el-tooltip>
+        </template>
+      </ex-table>
+      <add-edit
+        :id="modelId"
+        :sitem="sitem"
+        :show-model="showModel"
+        :is-detail="isDetail"
+        @refresh="searchList"
+        @cancel="showModel = false"
+      />
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+  </div>
+</template>
+   <script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import columns from "./columns";
+import asyncRequest from "@/apis/service/purchaseIn/purchaseReturn";
+import addEdit from "./addEdit";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "purchaseReturn",
+  mixins: [mixinPage, resToken],
+  components: {
+    addEdit,
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "purchaseReturn"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+  data() {
+    return {
+      select: "returnCode", //默认选择下拉框
+      s_input: "", //搜索框内容
+      sitem: null,
+      // 状态
+      statusOptions: [
+        // { id: "0", label: "禁用" },
+        { id: "0", label: "待发起审核" },
+        { id: "1", label: "待业务审核" },
+        { id: "2", label: "待通知库管" },
+        { id: "3", label: "待通知采购" },
+        { id: "4", label: "待通知财务" },
+        { id: "5", label: "完成退货" },
+      ],
+      loading: true,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        order_type: "1", //订单类型1为销售 2为咨询
+      },
+      tableData: [],
+      passwordModel: false,
+      passwordModelId: 0,
+      isPasswordDetail: false,
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns: columns,
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+
+  methods: {
+    restSearch() {
+      this.s_input = ""; //清除输入框内容
+      this.select = ""; //清除下拉框选中项
+      this.parmValue = {
+        order_type: "1", //订单类型1为销售 2为咨询
+
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      };
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.searchList();
+    },
+
+    openModal(id, isDetail, sitem) {
+      this.showModel = true;
+      this.modelId = id;
+      this.isDetail = isDetail;
+      this.sitem = sitem;
+    },
+    async deleteById(id, status) {
+      await this.$confirm("确定要删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const model = {
+            id: id,
+            status: status === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.status(model);
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "删除成功",
+              message: "",
+            });
+            this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    async searchList() {
+      this.loading = true;
+      console.log(this.parmValue);
+      let model = JSON.parse(JSON.stringify(this.parmValue));
+      console.log(model);
+
+      const res = await asyncRequest.list(model);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.pageInfo.total = Number(res.data.count);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+
+    async statusConfirm(id, status) {
+      let str = status === "1" ? "禁用" : "启用";
+      await this.$confirm("确定要改为" + str + "?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+          const model = {
+            id: id,
+            status: status === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.status(model);
+          if (res && res.code === 0) {
+            this.loading = false;
+            this.$notify.success({
+              title: "状态修改成功!",
+              message: "",
+            });
+            await this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    //物流公司查询
+    async handleCompany(e) {
+      console.log(e, "要求传快递简称,不传id"); //
+      if (e && e.code) {
+        // this.ruleForm.post_name = [e.code];
+        this.parmValue.postCompany = [e.shortName];
+        this.parmValue.page = 1;
+      }
+      console.log(this.parmValue.postCompany);
+      await this.searchList();
+    },
+    async handleValue() {
+      console.log(this.select);
+      console.log(this.s_input);
+      this.parmValue.returnCode =
+        this.select === "returnCode" ? this.s_input : "";
+      this.parmValue.orderCode =
+        this.select === "orderCode" ? this.s_input : "";
+      this.parmValue.apply_name =
+        this.select === "apply_name" ? this.s_input : "";
+      await this.searchList();
+    },
+    // 时间
+    async handleTime(e) {
+      if (e.startTime !== "") {
+        this.parmValue.start = e.startTime;
+      } else {
+        this.parmValue.start = "";
+      }
+      if (e.endTime !== "") {
+        this.parmValue.end = e.endTime;
+      } else {
+        this.parmValue.end = "";
+      }
+      if (this.parmValue.start !== "" && this.parmValue.end !== "") {
+        this.parmValue.page = 1;
+        await this.searchList();
+      }
+    },
+  },
+};
+</script>
+   <style lang="scss" scoped>
+.sellReturnList {
+}
+</style>
+   

+ 1 - 0
src/views/purchaseIn/wsmInOrder/index.vue

@@ -136,6 +136,7 @@
               </el-col>
               <el-col :span="6" style="width: 420px; padding: 0 0 0 10px">
                 <el-input
+                  clearable
                   placeholder="关键字"
                   v-model="input"
                   :size="searchSize"

+ 133 - 142
src/views/sellOut/returnOrder/components/return-record.vue

@@ -12,24 +12,31 @@
     <p>sitem:{{ status }}</p>
     <el-row>
       <el-col :span="12">
-        <el-form-item label="收货总数量" prop="get_goods_numbers">
+        <el-form-item label="退货总数量" prop="return_num">
           <el-input
-            :disabled="status != '1' && status != '0'"
-            v-model="ruleForm.get_goods_numbers"
-            placeholder="货总数量"
+            disabled
+            v-model="ruleForm.return_num"
+            placeholder="退货总数量"
           ></el-input>
         </el-form-item>
+        <!-- <el-form-item label="收货总数量" prop="receive">
+          <el-input
+            disabled
+            v-model="ruleForm.receive"
+            placeholder="收货总数量"
+          ></el-input>
+        </el-form-item> -->
       </el-col>
       <el-col :span="12">
-        <el-form-item label="可销售数量" prop="can_sell_numbers">
+        <el-form-item label="可销售数量" prop="normal">
           <el-input
             :disabled="status != '1' && status != '0'"
-            v-model="ruleForm.can_sell_numbers"
+            v-model="ruleForm.normal"
             placeholder="可销售数量"
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="12">
+      <el-col :span="24">
         <el-form-item label="其他备注" prop="remark">
           <el-input
             :disabled="status != '1' && status != '0'"
@@ -177,15 +184,11 @@
                           @click="checkRow(scope.$index)"
                         ></i>
                       </el-tooltip>
-                      <el-tooltip
-                        v-if="scope.row.edit"
-                        effect="dark"
-                        content="重置"
-                        placement="top"
-                      >
+
+                      <el-tooltip effect="dark" content="删除" placement="top">
                         <i
-                          class="el-icon-refresh-left tb-icon"
-                          @click="resetRow(scope.$index)"
+                          class="el-icon-delete-solid tb-icon"
+                          @click="deleteRow(scope.$index)"
                         ></i>
                       </el-tooltip>
                     </template>
@@ -271,19 +274,21 @@ export default {
       }
     };
     return {
+      newArr: [], //存储异常记录列表项
       arr: [],
       sitemGetNumber: "", //详情总收货量
       isShow: false, //用于情况1
       returnNO: "", //退货编号
       ruleForm: {
-        get_goods_numbers: "", //收货总数量
-        can_sell_numbers: "", //可销售数量
+        return_num: "", //
+        // receive: "", //收货总数量
+        normal: "", //可销售数量
         remark: "", //其他备注
         product_go: [], //表格参数
       },
-      anomalous_numbers: "", //异常数量
-      anomalous_reason_code: "", //异常原因
-      anomalous_remark: "", //异常备注
+      // anomalous_numbers: "", //异常数量
+      // anomalous_reason_code: "", //异常原因
+      // anomalous_remark: "", //异常备注
       // --
       btn_code: "",
       modelId: "",
@@ -298,14 +303,22 @@ export default {
       rulesThis: this.rules,
       // 验证规则
       rules: {
-        get_goods_numbers: [
+        return_num: [
           {
             required: true,
             trigger: "blur",
             validator: validatenumbers,
           },
-        ],
-        can_sell_numbers: [
+        ], //
+
+        // receive: [
+        //   {
+        //     required: true,
+        //     trigger: "blur",
+        //     validator: validatenumbers,
+        //   },
+        // ],
+        normal: [
           {
             required: true,
             trigger: "blur",
@@ -360,6 +373,7 @@ export default {
     async initForm() {
       this.loading = true;
       this.rulesThis = this.rules;
+      console.log(this.sitem);
       await this.getresultlist();
       await this.resetForm();
       this.loading = false;
@@ -373,24 +387,31 @@ export default {
           this.$refs.ruleForm.clearValidate();
           this.status = "";
           this.arr = [];
-          console.log(this.sitem);
-          let { child, status, received_num, normal_num, remark } = this.sitem;
+          this.newArr = [];
+          // console.log("sitem", this.sitem);
+          let { child, status, received_num, normal_num, remark, return_num } =
+            this.sitem;
           this.status = status;
-          console.log(child);
+          this.newArr = child;
+          console.log("newArr", this.newArr);
+
           child.forEach((ele) => {
             let obj = {
+              is_del: "0",
               anomalous_numbers: ele.error_num,
               anomalous_reason_code: ele.error_code,
               anomalous_remark: ele.error_remark,
               id: ele.id,
+              edit: false,
             };
             // console.log("1");
             this.arr.push(obj);
           });
-          console.log(this.arr);
+          console.log("arr", this.arr);
           this.ruleForm = {
-            get_goods_numbers: received_num, //收货总数量
-            can_sell_numbers: normal_num, //可销售数量
+            return_num: return_num,
+            receive: "", //收货总数量
+            normal: normal_num, //可销售数量
             remark: remark, //其他备注
             product_go: this.arr, //表格参数this.arr
           };
@@ -402,116 +423,82 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
-          let model = JSON.parse(JSON.stringify(this.ruleForm));
-          let thNo = "";
-          if (this.sitem) {
-            thNo = this.sitem.thNo;
+          const { product_go } = this.ruleForm;
+          let isok = true;
+          product_go.forEach((v) => {
+            if (v.edit) {
+              isok = false;
+            }
+          });
+          if (!isok) {
+            this.$message.warning("请保存异常情况记录表格!");
+            this.loading = false;
+            return;
+          }
+          const { receive, normal } = this.ruleForm;
+          const { return_num } = this.sitem;
+          let a = 0;
+          product_go.forEach((x) => {
+            a += Number(x.anomalous_numbers);
+          });
+
+          if (Number(return_num) !== Number(normal) + a) {
+            this.$message.warning("可销售数量+异常总数量不等于总退回数量!");
+            this.loading = false;
+            return;
           }
+          let allList = [];
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          delete model["product_go"];
+          model.errorlist = [];
+          model.thNo = this.sitem.thNo;
+
+          let list = JSON.parse(JSON.stringify(this.newArr));
+          product_go.forEach((x) => {
+            let index = this.newArr.findIndex((y) => y.id === x.id);
+            if (index !== -1) {
+              list.splice(index, 1);
+            }
+          });
+          list.forEach((v) => {
+            v.is_del = "1";
+          });
+          console.log(product_go);
+          allList.push(...product_go);
+          allList.push(...list);
+          console.log(allList);
+
           let arr = [];
           console.log(this.arr);
-          this.arr.map((ele) => {
+          allList.map((ele) => {
             let obj = {
-              error_num: ele.anomalous_numbers,
-              error_code: ele.anomalous_reason_code,
-              error_remark: ele.anomalous_remark,
+              id: ele.id,
+              is_del: ele.is_del,
+              error_num: ele.anomalous_numbers || "",
+              error_code: ele.anomalous_reason_code || "",
+              error_remark: ele.anomalous_remark || "",
             };
-            arr.push(obj);
+            model.errorlist.push(obj);
           });
-          let _model = {
-            thNo: thNo, //	退货编号
-            receive: model.get_goods_numbers, //收货数量
-            normal: model.can_sell_numbers, //正常数量
-            remark: model.remark, //
-            errorlist: arr, //
-          };
-          console.log(_model);
+
+          // console.log(model);
+
           // return;
-          const { get_goods_numbers, can_sell_numbers } = this.ruleForm;
-          // 判断收获总数量是否等于可销售数量(情况1:没有异常数量)
-          if (Number(get_goods_numbers) === Number(can_sell_numbers)) {
-            const res = await asyncRequest.returnCheck({}); //_model
-            if (res && res.code === 0) {
-              console.log("submit");
-              this.$notify.success({
-                title: res.message,
-                message: "",
-              });
-              this.$emit("refresh");
-              console.log("抛出事件给详情页");
-            } else if (res && res.code >= 100 && res.code <= 104) {
-              await this.logout();
-            } else {
-              this.$message.warning(res.message);
-            }
-          } else if (Number(get_goods_numbers) < Number(can_sell_numbers)) {
-            console.log(+get_goods_numbers, +can_sell_numbers);
-            this.$message.warning("可销售数量不能大于收货总数量!");
-          } else {
-            this.ruleForm.product_go.forEach((item) => {
-              if (!item.edit) {
-                this.edit = true;
-              }
-              this.totalNumber += Number(item.anomalous_numbers);
+          const res = await asyncRequest.returnCheck(model); //_model
+          this.loading = false;
+          if (res && res.code === 0) {
+            console.log("submit");
+            this.$notify.success({
+              title: res.message,
+              message: "",
             });
-            if (
-              this.edit &&
-              Number(this.totalNumber) + Number(can_sell_numbers) ==
-                Number(get_goods_numbers)
-            ) {
-              const res = await asyncRequest.returnCheck(_model);
-              if (res && res.code === 0) {
-                console.log("submit");
-                this.$notify.success({
-                  title: res.message,
-                  message: "",
-                });
-                this.$emit("refresh");
-              } else if (res && res.code >= 100 && res.code <= 104) {
-                await this.logout();
-              } else {
-                this.$message.warning(res.message);
-              }
-            } else {
-              this.$message.warning("异常数量不正确或者当前表格在编辑!");
-            }
-            this.totalNumber = 0;
+            this.$emit("refresh");
+            console.log("抛出事件给详情页");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
           }
-
-          this.totalNumber = 0;
-          // if (!this.tableForm.product_go.edit) {
-          //   console.log(this.$refs.ruleForm);
-          //   this.$refs.ruleForm.validateField("tableCheck");
-          // }
-          // let res = {};
-          // if (this.id === "add") {
-          //   delete model["id"];
-          //   res = await asyncRequest.add(model);
-          // } else {
-          //   res = await asyncRequest.update(model);
-          // }
-
-          //   this.loading = false;
-          //   if (res && res.code === 0) {
-          //     const title = this.id === "add" ? "添加成功!" : "修改成功!";
-          //     this.$notify.success({
-          //       title,
-          //       message: "",
-          //     });
-
-          //     if (this.id === "add") {
-          //       this.showModelThis = false;
-          //       this.$emit("refresh", false);
-          //     } else {
-          //       this.initForm();
-          //     }
-          //   } 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;
         }
       });
     },
@@ -543,21 +530,17 @@ export default {
       if (!isnumber(anomalous_numbers)) {
         this.$message.warning("异常数量必须为整数!");
         return;
-      } else if (
-        +anomalous_numbers + +this.ruleForm.can_sell_numbers <
-        +this.ruleForm.get_goods_numbers
-      ) {
-        this.$message.warning("当前可销售数量+异常数量小于总收货数量!");
-      } else if (
-        +anomalous_numbers + +this.ruleForm.can_sell_numbers >
-        +this.ruleForm.get_goods_numbers
+      }
+      console.log(this.ruleForm.return_num);
+      console.log(anomalous_numbers, this.ruleForm.normal);
+      if (
+        +anomalous_numbers + +this.ruleForm.normal !==
+        +this.ruleForm.return_num
       ) {
-        this.$message.warning("可销售数量+异常数量不能大于总收货数量!");
+        this.$message.warning("当前可销售数量+异常数量不等于总退货数量!");
         return;
       }
-      if (anomalous_remark.length > 20) {
-        this.$message.warning("异常备注字数不能超过250个!");
-      }
+
       if (anomalous_numbers == 0) {
         this.$message.info("异常数量为零,不用选择异常原因!");
         this.ruleForm.product_go[rowIndex].edit = false;
@@ -572,6 +555,8 @@ export default {
     },
     //编辑某一行
     editRow(rowIndex) {
+      console.log(rowIndex);
+      console.log(this.ruleForm.product_go[rowIndex].edit);
       let index = this.ruleForm.product_go.findIndex((v) => v.edit);
       console.log(index);
       if (index !== -1) {
@@ -582,6 +567,12 @@ export default {
         this.ruleForm.product_go[rowIndex].edit = true;
       }
     },
+    deleteRow(rowIndex) {
+      // console.log(rowIndex);
+      // console.log(this.ruleForm.product_go);
+      this.ruleForm.product_go.shift(rowIndex);
+      // console.log(this.ruleForm.product_go);
+    },
     //重置行内参数
     resetRow(rowIndex) {
       this.ruleForm.product_go[rowIndex].anomalous_numbers = "";

+ 2 - 2
src/views/sellOut/returnOrder/components/returnCheck.vue

@@ -247,7 +247,7 @@ export default {
               anomalous_reason_code: ele.error_code, //异常原因code
               anomalous_remark: ele.error_remark,
               check_value: ele.status,
-              check_remark: ele.error_remark,
+              check_remark: "",
             };
             this.voList.push(obj);
           });
@@ -287,7 +287,7 @@ export default {
       let _model = {
         thNo: this.thNo,
         errorlist: arr,
-        status:'3', //1待验货2待验货审核3待业务审核4完成 this.status + 1
+        status: "3", //1待验货2待验货审核3待业务审核4完成 this.status + 1
       };
       console.log(_model);
       const res = await asyncRequest.check(_model);

+ 5 - 3
src/views/sellOut/salesOrder/components/addForm.vue

@@ -36,7 +36,9 @@
                   :type="'1'"
                   :size="searchSize"
                   :value="ruleForm.supplierName"
-                  :disabled="false"
+                  :disabled="
+                    !(status === '0' && powers.some((item) => item == '005'))
+                  "
                   :isDetail="false"
                   @searchChange="supplierChange"
                 />
@@ -764,7 +766,7 @@ export default {
         if (valid) {
           this.loading = true;
           console.log(this.ruleForm);
-          const { good_code, customer_code,supplierNo} = JSON.parse(
+          const { good_code, customer_code, supplierNo } = JSON.parse(
             JSON.stringify(this.ruleForm)
           );
           const { good_stock } = JSON.parse(JSON.stringify(this.stockForm));
@@ -780,7 +782,7 @@ export default {
             return;
           }
           let model = {
-            supplierNo:supplierNo.join(","),
+            supplierNo: supplierNo.join(","),
             id: this.id,
             good_code,
             customer_code: customer_code.join(","), // 账号

+ 5 - 2
src/views/sellOut/salesOrder/components/order-out-table.vue

@@ -172,7 +172,7 @@
       :showModel="modelShowModel"
       :id="modelId"
       :sitem="modelItem"
-      @refresh="searchList"
+      @refresh="refresh"
     />
     <add-edit
       :id="modelId"
@@ -248,8 +248,11 @@ export default {
     this.initForm();
   },
   methods: {
+    refresh(){
+      this.$emit("refresh");
+    },
     async initForm() {
-      console.log("12");
+      // console.log("12");
       this.status = "";
       this.queryId = this.$route.query.id;
       // this.rulesThis = this.rules;

+ 15 - 10
src/views/sellOut/salesOrder/detail.vue

@@ -43,14 +43,6 @@
           v-if="status === '1' && powers.some((item) => item == '014')"
           >取消审核流程</el-button
         >
-        <el-button
-          type="primary"
-          plain
-          :size="'mini'"
-          @click="statusConfirm('3', '开始发货')"
-          v-if="status === '2' && powers.some((item) => item == '026')"
-          >开始发货
-        </el-button>
         <el-button
           @click="statusConfirm('-1', '作废该条信息')"
           type="danger"
@@ -92,10 +84,23 @@
             @refresh="initData()"
           />
         </el-collapse-item>
+        <el-collapse-item title="准备发货" name="6" v-if="status === '2'">
+          <el-button
+            class="fr"
+            style="margin: 0 0 10px 0"
+            type="primary"
+            plain
+            :size="'mini'"
+            @click="statusConfirm('3', '开始发货')"
+            v-if="status === '2' && powers.some((item) => item == '026')"
+            >开始发货
+          </el-button>
+        </el-collapse-item>
         <el-collapse-item title="销售出库单" name="3">
+          <!-- && status == 3 -->
           <order-out-table
             :newTime="newTime"
-            v-if="newTime !== '' && status == 3"
+            v-if="newTime !== '' && (status == 3 || status == 4)"
             :sitem="sitem"
             :id="queryId"
             @refresh="initData()"
@@ -169,7 +174,7 @@ export default {
   data() {
     return {
       finishStatus: "finish",
-      activeNames: ["-1", "0", "1", "2", "3", "4", "5", "10"],
+      activeNames: ["-1", "0", "1", "2", "3", "4", "5", "6", "10"],
       statusOptions: [
         { value: "0", label: "发起流程" },
         { value: "1", label: "反馈物流" },

+ 17 - 5
src/views/sellOut/sellAfterApply/serviceDetail.vue

@@ -61,7 +61,7 @@
           v-if="powers.some((item) => item == '040')"
         >
           <return-express
-            @refresh="initData"
+            @refresh="initData(true)"
             :returnCode="orderCode"
             v-if="s_status == '3'"
           ></return-express>
@@ -116,7 +116,7 @@ export default {
   },
   data() {
     return {
-      activeNames: ["0", "1", "2", "3", "4", "10"],
+      activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
       s_status: "", //存储详情接口状态
       statusList: [],
       sitem: null,
@@ -193,7 +193,7 @@ export default {
         this.$message.warning(res.message);
       }
     },
-    async initData() {
+    async initData(type) {
       let model = {
         returnCode: this.code,
       };
@@ -201,12 +201,24 @@ export default {
       if (res && res.code === 0 && res.data) {
         this.s_status = res.data.status;
         console.log(this.s_status);
-        console.log(res.data);
+        // console.log(res.data);
         this.sitem = res.data;
-        console.log(this.sitem);
+        // console.log(this.sitem);
         this.orderCode = res.data.returnCode;
         // console.log(this.orderCode);
         this.getNewTime();
+        if (type) {
+          this.$confirm("这是一段内容", "标题名称", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+          })
+            .then(() => {
+              console.log(this.routeGoto);
+            })
+            .catch(() => {
+              console.log("取消");
+            });
+        }
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {

+ 38 - 13
src/views/sellOut/sellReturnList/detail.vue

@@ -4,14 +4,14 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <p>noSendDetail</p>
+      <!-- <p>noSendDetail</p>
       <p>sellReturnDetail页面{{ powers }}</p>
       <p>status{{ status }}</p>
-      <p>{{ qid }}</p>
+      <p>{{ qid }}</p> -->
       <!-- <p>{{ sitem }}</p> -->
       <!-- <p>{{ newTime }}</p> -->
       <el-button
-        style="margin: 0 0 20px 0"
+        style="margin: 20px 0 20px 0"
         type="primary"
         plain
         :size="'mini'"
@@ -19,6 +19,22 @@
         v-if="status === '0' && powers.some((item) => item == '012')"
         >发起审核流程
       </el-button>
+      <el-button
+        type="danger"
+        plain
+        :size="'mini'"
+        @click="statusConfirm('-1', '作废该条信息', '')"
+        v-if="status === '0' && powers.some((item) => item == '015')"
+        >作废该条信息
+      </el-button>
+      <!-- <el-button
+        v-if="status === '0' && powers.some((item) => item == '012')"
+        @click="statusConfirm('-1', '作废该条信息', '')"
+        type="danger"
+        plain
+        :size="'mini'"
+        >作废该条信息</el-button
+      > -->
       <status-bar
         v-if="newTime !== ''"
         :newTime="newTime"
@@ -52,11 +68,14 @@
         <el-collapse-item
           title="通知库管"
           name="1"
-          v-if="powers.some((item) => item == '037') && status === '2'"
+          v-if="powers.some((item) => item == '037')"
         >
-          <div style="height: 60px; padding: 20px 0 0px 0">
+          <div
+            style="height: 60px; padding: 20px 0 0px 0"
+            v-if="status === '2'"
+          >
             <el-button
-              type="info"
+              type="primary"
               class="fr"
               size="mini"
               @click="statusConfirm('3', '确定我已知晓并同意')"
@@ -67,11 +86,14 @@
         <el-collapse-item
           title="通知采购部门"
           name="1"
-          v-if="powers.some((item) => item == '038') && status === '3'"
+          v-if="powers.some((item) => item == '038')"
         >
-          <div style="height: 60px; padding: 20px 0 0px 0">
+          <div
+            style="height: 60px; padding: 20px 0 0px 0"
+            v-if="status === '3'"
+          >
             <el-button
-              type="info"
+              type="primary"
               class="fr"
               size="mini"
               @click="statusConfirm('4', '确定我已知晓并同意')"
@@ -82,11 +104,14 @@
         <el-collapse-item
           title="通知财务部门"
           name="1"
-          v-if="powers.some((item) => item == '039') && status === '4'"
+          v-if="powers.some((item) => item == '039')"
         >
-          <div style="height: 60px; padding: 20px 0 0px 0">
+          <div
+            style="height: 60px; padding: 20px 0 0px 0"
+            v-if="status === '4'"
+          >
             <el-button
-              type="info"
+              type="primary"
               class="fr"
               size="mini"
               @click="statusConfirm('5', '确定我已知晓并同意')"
@@ -194,7 +219,7 @@ export default {
       })
         .then(async () => {
           if (status === "-1") {
-            await this.deleteById(message);
+            await this.delete(message);
           } else {
             console.log(status, message, remark);
             await this.setstatus(status, message, remark);

+ 22 - 80
src/views/sellOut/sellReturnList/index.vue

@@ -65,7 +65,7 @@
                 <el-col :span="6" style="width: 400px; padding: 0 0 0 10px">
                   <el-input
                     clearable
-                    placeholder="关键字"
+                    placeholder="请选择"
                     v-model="s_input"
                     :size="searchSize"
                     class="input-with-select"
@@ -78,13 +78,13 @@
                     >
                       <el-option
                         label="退货单编号"
-                        value="returnNo"
+                        value="returnCode"
                       ></el-option>
                       <el-option
                         label="采购订单编号"
-                        value="orderNo"
+                        value="orderCode"
                       ></el-option>
-                      <el-option label="申请人" value="applyer"></el-option>
+                      <el-option label="申请人" value="apply_name"></el-option>
                     </el-select>
                     <el-button
                       slot="append"
@@ -227,7 +227,6 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-// import statusList from "@/assets/js/statusList";
 import columns from "./columns";
 import asyncRequest from "@/apis/service/sellOut/sellReturnList";
 import addEdit from "./addEdit";
@@ -255,17 +254,8 @@ export default {
   },
   data() {
     return {
-      select: "",
-      s_input: "",
-      // statusList: [
-      //   // { value: "0", label: "待验收" },
-      //   { value: "0", label: "待发起审核" },
-      //   { value: "1", label: "待业务审核" },
-      //   { value: "2", label: "待通知库管" },
-      //   { value: "3", label: "待通知采购" },
-      //   { value: "4", label: "待通知财务" },
-      //   { value: "5", label: "完成退货" },
-      // ],
+      select: "returnCode", //默认选择下拉框
+      s_input: "", //搜索框内容
       sitem: null,
       // 状态
       statusOptions: [
@@ -274,30 +264,23 @@ export default {
         { id: "1", label: "待业务审核" },
         { id: "2", label: "待通知库管" },
         { id: "3", label: "待通知采购" },
-
         { id: "4", label: "待通知财务" },
         { id: "5", label: "完成退货" },
       ],
-      // statusList: statusList,
       loading: true,
       showModel: false,
       isDetail: false,
       modelId: 0,
       parmValue: {
-        order_type: "1", //订单类型1为销售 2为咨询
-
-        CG_numbers: "", //采购单号
-        returnNumber: "", //退货单编号
-        returnStoreNum: "", //退货仓库编号
-        returnCompanyNum: "", //退货公司编号
-        applyer: "", //申请人
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        apply_name: "", //申请人
         start: "",
         end: "",
         status: "", //节点状态
-
-        // --
         page: 1, // 页码
         size: 15, // 每页显示条数
+        order_type: "1", //订单类型1为销售 2为咨询
       },
       tableData: [],
       passwordModel: false,
@@ -332,11 +315,9 @@ export default {
       this.parmValue = {
         order_type: "1", //订单类型1为销售 2为咨询
 
-        CG_numbers: "", //采购单号
-        returnNumber: "", //退货单编号
-        returnStoreNum: "", //退货仓库编号
-        returnCompanyNum: "", //退货公司编号
-        applyer: "", //申请人
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        apply_name: "", //申请人
         start: "",
         end: "",
         status: "", //节点状态
@@ -391,28 +372,8 @@ export default {
       console.log(this.parmValue);
       let model = JSON.parse(JSON.stringify(this.parmValue));
       console.log(model);
-      let _model = {
-        // thNo: model.returnNumber, //退货编号
-        status: model.status, //节点状态
-        post_code: model.postNumber, //快递编码
-        post_compay: model.postCompany, //	快递公司
-        customer_code: model.clientNumber, //客户code
-        // order_code: model.sellOrderNumber, //	确认单code
-        out_code: model.sellOutNumber, //	出库code
-        order_type: model.order_type, //订单类型1为销售 2为咨询
-
-        cgdNo: "",
-        //可用搜索条件
-        returnCode: model.returnNumber, //return_code
 
-        orderCode: model.CG_numbers,
-        apply_name: model.applyer,
-        start: model.start,
-        end: model.end,
-        size: model.size,
-        page: model.page,
-      };
-      const res = await asyncRequest.list(_model);
+      const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
@@ -427,7 +388,7 @@ export default {
 
     async statusConfirm(id, status) {
       let str = status === "1" ? "禁用" : "启用";
-      await this.$confirm("确定要改为" + str + "?", {
+      this.$confirm("确定要改为" + str + "?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -470,32 +431,13 @@ export default {
     async handleValue() {
       console.log(this.select);
       console.log(this.s_input);
-      switch (this.select) {
-        case "returnNo":
-          this.parmValue.returnNumber = this.s_input;
-          await this.searchList();
-          break;
-        case "returnStoreNo":
-          this.parmValue.returnStoreNum = this.s_input;
-          await this.searchList();
-
-          break;
-        case "returnCompanyNo":
-          this.parmValue.returnCompanyNum = this.s_input;
-          await this.searchList();
-
-          break;
-        case "applyer":
-          this.parmValue.applyer = this.s_input;
-          await this.searchList();
-          break;
-        default:
-          //采购单编号
-          this.parmValue.CG_numbers = this.s_input;
-          await this.searchList();
-
-          break;
-      }
+      this.parmValue.returnCode =
+        this.select === "returnCode" ? this.s_input : "";
+      this.parmValue.orderCode =
+        this.select === "orderCode" ? this.s_input : "";
+      this.parmValue.apply_name =
+        this.select === "apply_name" ? this.s_input : "";
+      await this.searchList();
     },
     // 时间
     async handleTime(e) {

+ 17 - 0
text.text

@@ -0,0 +1,17 @@
+采购工差单管理
+{
+    采购单管理详情接口缺少工差单信息字段
+    采购工差单详情列表接口缺少判断是销售工差单还是咨询工差单
+
+}
+销售订单退货(未发货)
+{
+    缺少订单退货流程,业务审批用
+}
+流程中心
+{
+    返回的id值不正确,需要添加一个用于判断订单是咨询还是销售的字段,返回的code值不正确。
+    待办{
+        
+    }
+}