zhangjinxing 3 anni fa
parent
commit
7e40b33d85

+ 1 - 1
src/apis/service/sellOut/sellReturnList/index.js

@@ -20,4 +20,4 @@ export default {
   returnCheck: (data, params) => http(api + "reorderexam", data, "post", params),
 
 };
-   
+

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

@@ -15,6 +15,14 @@
             @click="diffAdd = true"
             >填写总工差</el-button
           >
+          <el-button
+            style="margin: 0 10px 0 0"
+            type="primary"
+            :size="'mini'"
+            class="fr"
+            @click="purchaseReturnAdd = true"
+            >新建采购单退货</el-button
+          >
         </div>
 
         <!-- <span class="fr">
@@ -43,7 +51,7 @@
             @refresh="initData()"
           />
           <!-- 工差单表格 -->
-          <work-diff-table ></work-diff-table>
+          <work-diff-table></work-diff-table>
         </el-collapse-item>
         <el-collapse-item title="备货入库单" name="2">
           <purchase-order-in-table
@@ -70,6 +78,13 @@
         @refresh="initData"
         @cancel="diffAdd = false"
       />
+      <!-- 采购单退货弹窗 -->
+      <purchase-return-add
+        :sitem="sitem"
+        :show-model="purchaseReturnAdd"
+        @refresh="initData"
+        @cancel="purchaseReturnAdd = false"
+      />
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -84,6 +99,7 @@ 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";
+import PurchaseReturnAdd from "@/views/purchaseIn/purchaseReturn/addEdit.vue"; //采购单退货弹窗
 export default {
   name: "purchaseOrderDetail",
   mixins: [mixinPage, resToken],
@@ -92,6 +108,7 @@ export default {
     purchaseOrderInTable,
     diffOrderAdd,
     WorkDiffTable,
+    PurchaseReturnAdd, //采购单退货弹窗
   },
   computed: {
     powers() {
@@ -147,6 +164,7 @@ export default {
       queryId: "",
       diffAdd: false,
       orderCode: "",
+      purchaseReturnAdd:false,//采购单退货弹窗
     };
   },
   mounted() {
@@ -160,6 +178,7 @@ export default {
 
     openModal() {
       this.diffAdd = true;
+      this.purchaseReturnAdd = true;
     },
     async examForm(e) {
       if (!this.loading) {

+ 165 - 299
src/views/purchaseIn/purchaseReturn/addEdit.vue

@@ -3,8 +3,8 @@
     :title="title"
     :center="true"
     align="left"
-    top="5vh"
-    width="1040px"
+    top="15vh"
+    width="600px"
     @close="closeModel"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
@@ -13,6 +13,10 @@
     element-loading-spinner="el-icon-loading"
     element-loading-background="rgba(0, 0, 0, 0.8)"
   >
+    <!-- {{sitem}} -->
+
+    <p>isDetail {{ isDetail }}</p>
+    <p>id{{ id }}</p>
     <el-card>
       <el-row :gutter="10">
         <el-col :span="24">
@@ -24,254 +28,129 @@
             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 label="商品名称" prop="good_name">
+              <el-input v-model="ruleForm.good_name" disabled></el-input>
             </el-form-item>
-            <el-form-item label="手机号" prop="tel">
-              <el-input v-model="ruleForm.tel" :disabled="isDetail"></el-input>
+            <el-form-item label="商品分类" prop="goods_class">
+              <el-input v-model="ruleForm.goods_class" disabled></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 label="未发货数量" prop="wsend_num">
+              <el-input v-model="ruleForm.wsend_num" disabled></el-input>
             </el-form-item>
-            <el-form-item label="确认密码" prop="password2" v-if="id === 'add'">
+
+            <el-form-item label="退货数量" prop="return_num">
               <el-input
-                type="password"
-                placeholder="再次输入密码"
-                :maxlength="20"
-                v-model="ruleForm.password2"
+                v-model="ruleForm.return_num"
+                :disabled="isDetail"
               ></el-input>
             </el-form-item>
           </el-form>
         </el-col>
-        <el-col :span="24" style="text-align: right;">
+        <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-button @click="showModelThis = false">{{
+            isDetail ? "关 闭" : "取 消"
+          }}</el-button>
         </el-col>
       </el-row>
     </el-card>
   </el-dialog>
-   </template>
+</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();
+import asyncRequest from "@/apis/service/purchaseIn/purchaseReturn";
+import resToken from "@/mixins/resToken";
+import { isnumber } from "@/utils/validate";
+export default {
+  name: "purchaseReturnAdd",
+  props: ["showModel", "id", "isDetail", "sitem"],
+  mixins: [resToken],
+  data() {
+    const validatename = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("退货数量不能为空!"));
+      } else {
+        if (value.length > 50) {
+          callback(new Error("退货数量位数不能超过50位!"));
         } else {
-          if (!validEmail(value)) {
-            callback(new Error("邮箱格式不正确!"));
+          if (!isnumber(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!!");
+    };
+    return {
+      loading: false,
+      title: "新建采购单退货",
+      showModelThis: this.showModel,
+      ruleForm: {
+        cgdNo: "",
+        return_num: "", //退货数量
+        good_name: "",
+        goods_class: "",
+        wsend_num: "",
       },
-      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;
+      rulesThis: this.rules,
+      rules: {
+        return_num: [
+          {
+            required: true,
+            validator: validatename,
+            trigger: "blur",
+          },
+        ],
+        good_name: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请填写商品名称",
+          },
+        ],
+        goods_class: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请填写商品分类名称",
+          },
+        ],
+        wsend_num: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请填写商品数量",
+          },
+        ],
       },
-      // 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 });
+    };
+  },
+  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;
+      this.rulesThis = this.rules;
+      await this.resetForm(this.sitem);
+      this.loading = false;
+    },
+    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;
@@ -280,83 +159,70 @@
       } 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);
-            }
+    },
+    async resetForm(sitem) {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          console.log(this.sitem);
+          const { good_name, goods_class, wsend_num, cgdNo } = this.sitem;
+
+          // const { username, nickname, mobile, email, roleid, status, item } =
+          //   sitem;
+          this.ruleForm = {
+            cgdNo: cgdNo || "",
+            return_num: "", //退货数量
+            good_name: good_name || "",
+            goods_class: goods_class || "",
+            wsend_num: wsend_num || "",
+          };
+        }
+      });
+    },
+
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+
+          const model = JSON.parse(JSON.stringify(this.ruleForm));
+          if (Number(model.return_num) > Number(model.wsend_num)) {
+            this.$message.warning("退货数量不能大于未发货数量");
             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);
-            }
+            return;
+          }
+          delete model["good_name"];
+          delete model["goods_class"];
+          delete model["wsend_num"];
+          const res = await asyncRequest.add(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 {
-            console.log("error submit!!");
-            return false;
+            this.$message.warning(res.message);
           }
-        });
-      },
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
     },
- 
-  };
-  </script>
+  },
+};
+</script>
 
    <style lang="scss" scoped>
-   .purchaseReturn {
-    
-   }
-   </style>
+.purchaseReturn {
+}
+</style>
    

+ 26 - 22
src/views/purchaseIn/purchaseReturn/columns.js

@@ -1,7 +1,7 @@
 export default [
         {
-          prop: "orderCode",
-          label: "采购单编号",
+          prop: "cgdNo",
+          label: "采购单编号",
           width:"160"
         },
         {
@@ -12,38 +12,41 @@ export default [
         // {确认单编号}
         // {order_type类型}
         {
-          prop:"good_code",
+          prop:"good_type_code",
           label:"商品属性编码",
           width:"140"
         },
+        {
+          prop:"good_class",
+          label:"商品分类",
+          width:"130",
+        },
         {
           prop:"good_name",
           label:"商品名称",
           width:"150"
         },
         {
-          prop: "num",
+          prop: "return_num",
           label: "退货数量",
         },
+ 
+        // {
+        //   prop: "good_price",
+        //   label: "商品单价",
+        // },
         {
-          prop: "total_num",
-          label: "订单总数",
-        },
-        {
-          prop: "error_msg",
-          label: "退货原因",
-          width:"160"
+          prop: "good_total",
+          label: "退货总金额",
+          width:"100"
         },
         {
-            prop:"apply_name",
-            label:"申请人",
+            prop:"post_company",
+            label:"物流公司",
         },
-
-        
-        
         {
-          prop: "return_total",
-          label: "退货总金额",
+          prop: "post_fee",
+          label: "物流费",
           width:"120"
         },
         {
@@ -53,10 +56,11 @@ export default [
           width: "120px",
         },
         {
-          prop: "addtime",
-          label: "申请时间",
-          sortable: true,
-          width:150
+          prop: "order_type",
+          label: "退货来源",
+          // 1备库 2咨询
+          _slot_:"order_type",
+          width:"120px"
         },
         {
           prop: "",

+ 68 - 46
src/views/purchaseIn/purchaseReturn/index.vue

@@ -29,24 +29,14 @@
           <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="退货单状态"
+                    placeholder="状态"
                     style="width: 100%"
                     @change="
                       pageInfo.curr = 1;
@@ -62,6 +52,7 @@
                     />
                   </el-select>
                 </el-col>
+                <!-- 下拉筛选 -->
                 <el-col :span="6" style="width: 400px; padding: 0 0 0 10px">
                   <el-input
                     clearable
@@ -80,11 +71,12 @@
                         label="退货单编号"
                         value="returnCode"
                       ></el-option>
+                      <el-option label="采购单编号" value="cgdNo"></el-option>
                       <el-option
-                        label="采购订单编号"
-                        value="orderCode"
+                        label="商品属性编码"
+                        value="good_type_code"
                       ></el-option>
-                      <el-option label="申请人" value="apply_name"></el-option>
+                      <el-option label="商品名称" value="good_name"></el-option>
                     </el-select>
                     <el-button
                       slot="append"
@@ -146,6 +138,28 @@
             "
           ></el-tag>
         </template>
+        <template #order_type="{ scope }">
+          <!-- <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '0' ? 'warning' : ''"
+            v-text="
+              (
+                order_type_options.find(
+                  (item) => item.id == scope.row.order_type
+                ) || {}
+              ).label || '--'
+            "
+          ></el-tag> -->
+          <p
+            v-text="
+              (
+                order_type_options.find(
+                  (item) => item.id == scope.row.order_type
+                ) || {}
+              ).label || '--'
+            "
+          ></p>
+        </template>
         <template #operation="{ scope }">
           <el-tooltip
             v-if="powers.some((item) => item == '002')"
@@ -257,35 +271,37 @@ export default {
       select: "returnCode", //默认选择下拉框
       s_input: "", //搜索框内容
       sitem: null,
+      order_type_options: [
+        { id: "1", label: "备库单" },
+        { id: "2", label: "咨询单" },
+      ],
       // 状态
       statusOptions: [
         // { id: "0", label: "禁用" },
-        { id: "0", label: "待发起审核" },
-        { id: "1", label: "待业务审核" },
-        { id: "2", label: "待通知库管" },
-        { id: "3", label: "待通知采购" },
-        { id: "4", label: "待通知财务" },
-        { id: "5", label: "完成退货" },
+        // { id: "0", label: "待发起审核" },
+        { id: "0", label: "待业务审核" },
+        // { id: "1", label: "待业务审核" },
+        { id: "1", label: "待通知财务" },
+        // { id: "2", 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: "",
+        cgdNo: "", //采购单编号
+        returnCode: "", //退货单编号
+        good_type_code: "", //商品属性编号
+        good_name: "", //商品名称
+        status: "", //节点状态
         status: "", //节点状态
         page: 1, // 页码
         size: 15, // 每页显示条数
-        order_type: "1", //订单类型1为销售 2为咨询
       },
-      tableData: [],
-      passwordModel: false,
-      passwordModelId: 0,
-      isPasswordDetail: false,
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
@@ -311,15 +327,12 @@ export default {
   methods: {
     restSearch() {
       this.s_input = ""; //清除输入框内容
-      this.select = ""; //清除下拉框选中项
+      this.select = "returnCode"; //清除下拉框选中项
       this.parmValue = {
-        order_type: "1", //订单类型1为销售 2为咨询
-
-        returnCode: "", //销售退货code
-        orderCode: "", //销售订单code
-        apply_name: "", //申请人
-        start: "",
-        end: "",
+        cgdNo: "", //采购单编号
+        returnCode: "", //退货单编号
+        good_type_code: "", //商品属性编号
+        good_name: "", //商品名称
         status: "", //节点状态
         page: 1, // 页码
         size: 15, // 每页显示条数
@@ -372,11 +385,18 @@ export default {
       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);
+        this.tableData.forEach((v) => {
+          v.good_class = "";
+          if (v.can && v.can.length > 0) {
+            v.can.forEach((x, i) => {
+              v.good_class += i === 0 ? x.name : "/" + x.name;
+            });
+          }
+        });
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {
@@ -429,14 +449,16 @@ export default {
       await this.searchList();
     },
     async handleValue() {
-      console.log(this.select);
-      console.log(this.s_input);
+      // 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 : "";
+      this.parmValue.cgdNo = this.select === "cgdNo" ? this.s_input : "";
+      this.parmValue.good_type_code =
+        this.select === "good_type_code" ? this.s_input : "";
+      this.parmValue.good_name =
+        this.select === "good_name" ? this.s_input : "";
+
       await this.searchList();
     },
     // 时间

+ 5 - 29
src/views/sellOut/returnOrder/components/return-record.vue

@@ -19,13 +19,7 @@
             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="normal">
@@ -281,15 +275,10 @@ export default {
       returnNO: "", //退货编号
       ruleForm: {
         return_num: "", //
-        // receive: "", //收货总数量
         normal: "", //可销售数量
         remark: "", //其他备注
         product_go: [], //表格参数
       },
-      // anomalous_numbers: "", //异常数量
-      // anomalous_reason_code: "", //异常原因
-      // anomalous_remark: "", //异常备注
-      // --
       btn_code: "",
       modelId: "",
       options: [],
@@ -309,15 +298,7 @@ export default {
             trigger: "blur",
             validator: validatenumbers,
           },
-        ], //
-
-        // receive: [
-        //   {
-        //     required: true,
-        //     trigger: "blur",
-        //     validator: validatenumbers,
-        //   },
-        // ],
+        ], 
         normal: [
           {
             required: true,
@@ -373,7 +354,7 @@ export default {
     async initForm() {
       this.loading = true;
       this.rulesThis = this.rules;
-      console.log(this.sitem);
+      // console.log(this.sitem);
       await this.getresultlist();
       await this.resetForm();
       this.loading = false;
@@ -410,7 +391,6 @@ export default {
           console.log("arr", this.arr);
           this.ruleForm = {
             return_num: return_num,
-            receive: "", //收货总数量
             normal: normal_num, //可销售数量
             remark: remark, //其他备注
             product_go: this.arr, //表格参数this.arr
@@ -435,7 +415,7 @@ export default {
             this.loading = false;
             return;
           }
-          const { receive, normal } = this.ruleForm;
+          const {  normal } = this.ruleForm;
           const { return_num } = this.sitem;
           let a = 0;
           product_go.forEach((x) => {
@@ -480,11 +460,7 @@ export default {
             };
             model.errorlist.push(obj);
           });
-
-          // console.log(model);
-
-          // return;
-          const res = await asyncRequest.returnCheck(model); //_model
+          const res = await asyncRequest.returnCheck(model); //退货验货接口
           this.loading = false;
           if (res && res.code === 0) {
             console.log("submit");

+ 25 - 49
src/views/sellOut/returnOrder/components/returnCheck.vue

@@ -1,18 +1,18 @@
 <template>
-  <el-row class="addForm">
+  <el-row class="returnCheck">
     <el-col :span="24">
       <el-form
         :model="tableForm"
         :rules="tableFormThis"
         ref="tableForm"
         :size="'mini'"
-        class="demo-tableForm product_go"
+        class="demo-tableForm errorlist"
       >
-        <!-- {{ tableForm.product_go }} -->
+        <!-- {{ tableForm.errorlist }} -->
         <!-- <p>{{ sitem }}</p> -->
         <el-form-item label="入库情况">
           <el-table
-            :data="tableForm.product_go"
+            :data="tableForm.errorlist"
             border
             :size="'mini'"
             row-key="key"
@@ -21,7 +21,7 @@
               <template slot-scope="scope">
                 <el-form-item
                   :style="!scope.row.edit ? 'margin:0' : ''"
-                  :prop="'product_go.' + scope.$index + '.anomalous_numbers'"
+                  :prop="'errorlist.' + scope.$index + '.anomalous_numbers'"
                 >
                   <p>
                     {{ scope.row.anomalous_numbers }}
@@ -33,7 +33,7 @@
               <template slot-scope="scope">
                 <el-form-item
                   :style="!scope.row.edit ? 'margin:0' : ''"
-                  :prop="'product_go.' + scope.$index + '.anomalous_reason'"
+                  :prop="'errorlist.' + scope.$index + '.anomalous_reason'"
                 >
                   <p>{{ scope.row.anomalous_reason }}</p>
                 </el-form-item>
@@ -43,7 +43,7 @@
               <template slot-scope="scope">
                 <el-form-item
                   :style="!scope.row.edit ? 'margin:0' : ''"
-                  :prop="'product_go.' + scope.$index + '.anomalous_remark'"
+                  :prop="'errorlist.' + scope.$index + '.anomalous_remark'"
                 >
                   <p>{{ scope.row.anomalous_remark }}</p>
                 </el-form-item>
@@ -53,7 +53,7 @@
               <template slot-scope="scope">
                 <el-form-item
                   :style="!scope.row.edit ? 'margin:0' : ''"
-                  :prop="'product_go.' + scope.$index + '.check_value'"
+                  :prop="'errorlist.' + scope.$index + '.check_value'"
                 >
                   <el-select
                     :disabled="!scope.row.edit"
@@ -76,7 +76,7 @@
               <template slot-scope="scope">
                 <el-form-item
                   :style="!scope.row.edit ? 'margin:0' : ''"
-                  :prop="'product_go.' + scope.$index + '.check_remark'"
+                  :prop="'errorlist.' + scope.$index + '.check_remark'"
                   :rules="{
                     required: true,
                     message: '审核备注不能为空',
@@ -127,15 +127,6 @@
               </template>
             </el-table-column>
           </el-table>
-          <!-- <el-col :span="24">
-            <exam-form
-              :statusList="statusList"
-              :newTime="newTime"
-              :disabled="false"
-              :isMust="false"
-              @searchChange="examForm"
-            />
-          </el-col> -->
 
           <el-col :span="24" style="text-align: right; padding: 30px 0 10px 0">
             <el-button
@@ -194,7 +185,7 @@ export default {
       status: "",
       loading: false,
       tableForm: {
-        product_go: [],
+        errorlist: [],
       },
       tableFormThis: config.tableFormThis,
       voList: [],
@@ -214,14 +205,6 @@ export default {
   methods: {
     async initForm() {
       this.loading = true;
-      this.columns = [];
-      // console.log(this.newTime);
-      // console.log(this.sitem);
-      // console.log(this.sitem);
-      // console.log(this.sitem);
-      // await this.getresultlist();
-      // this.thNo = this.sitem.thNo;
-      // console.log(this.thNo);
       await this.resetForm();
       this.loading = false;
     },
@@ -232,13 +215,10 @@ export default {
           this.$refs.tableForm.resetFields();
           this.$refs.tableForm.clearValidate();
           console.log(this.sitem);
-          // console.log(this.sitem);
-
           let { child, thNo, status } = this.sitem;
           this.status = status;
           this.thNo = thNo;
           console.log(child);
-
           child.map((ele) => {
             let obj = {
               id: ele.id,
@@ -251,11 +231,10 @@ export default {
             };
             this.voList.push(obj);
           });
-          // console.log(this.voList);
           let list = JSON.parse(JSON.stringify(this.voList));
           list.forEach((v) => {
             v.edit = false;
-            this.tableForm.product_go.push(v);
+            this.tableForm.errorlist.push(v);
           });
         }
       });
@@ -263,7 +242,7 @@ export default {
 
     async submitForm() {
       let index = -1;
-      this.tableForm.product_go.forEach((v, i) => {
+      this.tableForm.errorlist.forEach((v, i) => {
         if (v.edit && index === -1) {
           index = i;
         }
@@ -275,8 +254,8 @@ export default {
       console.log(this.tableForm);
       let arr = [];
       let model = JSON.parse(JSON.stringify(this.tableForm));
-      console.log(model.product_go);
-      model.product_go.map((ele) => {
+      console.log(model.errorlist);
+      model.errorlist.map((ele) => {
         let obj = {
           id: ele.id,
           remark: ele.anomalous_remark,
@@ -284,13 +263,11 @@ export default {
         };
         arr.push(obj);
       });
-      let _model = {
-        thNo: this.thNo,
-        errorlist: arr,
-        status: "3", //1待验货2待验货审核3待业务审核4完成 this.status + 1
-      };
-      console.log(_model);
-      const res = await asyncRequest.check(_model);
+      model.thNo = this.thNo;
+      model.errorlist = arr;
+      model.status = "3"; //1待验货2待验货审核3待业务审核4完成 this.status + 1
+      console.log(model);
+      const res = await asyncRequest.check(model); //验货审核orderbce
       if (res && res.code === 0) {
         console.log("submit");
         this.$notify.success({
@@ -298,7 +275,6 @@ export default {
           message: "",
         });
         this.$emit("refresh");
-        console.log("退货验收审核成功");
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {
@@ -308,26 +284,26 @@ export default {
     //异常原因筛选
     //保存某一行
     checkRow(rowIndex) {
-      const { check_value, check_remark } = this.tableForm.product_go[rowIndex];
+      const { check_value, check_remark } = this.tableForm.errorlist[rowIndex];
       if (check_value != "" && check_remark != "") {
-        this.tableForm.product_go[rowIndex].edit = false;
+        this.tableForm.errorlist[rowIndex].edit = false;
       } else {
         this.$message.warning("审核情况或审核备注不能为空");
       }
     },
     //编辑某一行
     editRow(rowIndex) {
-      let index = this.tableForm.product_go.findIndex((v) => v.edit);
+      let index = this.tableForm.errorlist.findIndex((v) => v.edit);
       if (index !== -1) {
         this.$message.warning("请完成其他行的编辑!");
         return;
       } else {
-        this.tableForm.product_go[rowIndex].edit = true;
+        this.tableForm.errorlist[rowIndex].edit = true;
       }
     },
     resetRow(rowIndex) {
-      this.tableForm.product_go[rowIndex].check_remark = "";
-      this.tableForm.product_go[rowIndex].check_value = "agree";
+      this.tableForm.errorlist[rowIndex].check_remark = "";
+      this.tableForm.errorlist[rowIndex].check_value = "agree";
     },
   },
 };

+ 0 - 8
src/views/sellOut/returnOrder/detail.vue

@@ -15,7 +15,6 @@
       />
       <el-collapse v-model="activeNames">
         <el-collapse-item title="退货验收记录" name="0">
-          <!-- <add-edit-form :sitem="sitem"></add-edit-form> -->
           <return-record
             :sitem="s_sitem"
             @refresh="initData"
@@ -24,8 +23,6 @@
         </el-collapse-item>
 
         <el-collapse-item title="退货验收审核" name="1">
-          <!-- <return-check :sitem="sitem"></return-check> -->
-          <!--  -->
           <return-check
             v-if="newTime != '' && status == '2'"
             :newTime="newTime"
@@ -66,7 +63,6 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-// import asyncRequest from "@/apis/service/purchaseIn/purchaseOrder/detail";
 import asyncRequest from "@/apis/service/sellOut/returnOrder";
 import ReturnRecord from "./components/return-record.vue";
 import ReturnCheck from "./components/returnCheck.vue";
@@ -190,9 +186,6 @@ export default {
         });
     },
     async initData() {
-      // console.log(this.sitem);
-      // if (this.sitem) {
-      // let { thNo } = this.sitem;
       let model = {
         thNo: this.qid,
       };
@@ -200,7 +193,6 @@ export default {
       if (res && res.code === 0 && res.data) {
         this.status = res.data.status;
         this.s_sitem = res.data;
-        console.log(res.data);
         this.orderCode =res.data.orderCode;
         this.getNewTime();
       } else if (res && res.code >= 100 && res.code <= 104) {

+ 0 - 12
src/views/sellOut/returnOrder/index.vue

@@ -136,14 +136,6 @@
                   ></el-button>
                 </el-input>
               </el-col>
-              <!-- <el-col :span="4" style="width: 54px">
-                <el-button
-                  :size="searchSize"
-                  type="primary"
-                  class="fr"
-                  icon="el-icon-search"
-                  @click="searchList"
-              /></el-col> -->
               <el-col :span="6" style="width: 66px">
                 <el-button
                   type="warning"
@@ -313,10 +305,6 @@ export default {
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
-      tableData: [],
-      passwordModel: false,
-      passwordModelId: 0,
-      isPasswordDetail: false,
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数

+ 21 - 45
src/views/sellOut/salesOrder/addEditForm.vue

@@ -16,13 +16,13 @@
       >
         <el-form-item
           label="退货原因"
-          prop="returnReason"
+          prop="errorCode"
           v-if="id === 'add' || isDetail"
         >
           <el-select
             :disabled="isDetail"
             style="width: 100%"
-            v-model="ruleForm.returnReason"
+            v-model="ruleForm.errorCode"
             placeholder="退换货原因"
           >
             <el-option
@@ -35,7 +35,7 @@
           </el-select>
         </el-form-item>
 
-        <el-form-item label="退货备注" prop="return_remark">
+        <el-form-item label="退货备注" prop="remark">
           <!-- <el-input v-model="ruleForm.tel" :disabled="isDetail"></el-input> -->
           <el-input
             :disabled="isDetail"
@@ -43,7 +43,7 @@
             maxlength="250"
             show-word-limit
             placeholder="请填写备注"
-            v-model="ruleForm.return_remark"
+            v-model="ruleForm.remark"
           />
         </el-form-item>
         <el-form-item label="仓库信息">
@@ -633,10 +633,10 @@ export default {
       showModelThis: this.showModel,
       ruleForm: {
         get_return_num: "",
-        outCode: "", //出库单编号
-        return_remark: "", //退货备注
+        orderCode: "", //出库单编号
+        remark: "", //退货备注
         return_num: "", //退货数量
-        returnReason: [], //退货原因
+        errorCode: "", //退货原因
         // email: "",
         // role_id: "",
         // status: "1",
@@ -644,7 +644,7 @@ export default {
       },
       rulesThis: this.rules,
       rules: {
-        returnReason: [
+        errorCode: [
           {
             required: true,
             message: "请选择退货原因",
@@ -659,7 +659,7 @@ export default {
             trigger: "blur",
           },
         ],
-        return_remark: [
+        remark: [
           {
             required: true,
             message: "请输入退货备注",
@@ -766,26 +766,14 @@ export default {
       let model = JSON.parse(JSON.stringify(this.sitem));
       this.ruleForm = {
         get_return_num: model.addrinfo,
-        outCode: "", //出库单编号
-        return_remark: model.remark, //退货备注
+        orderCode: "", //出库单编号
+        remark: model.remark, //退货备注
         return_num: model.num, //退货数量
-        returnReason: [model.error_msg], //退货原因
+        errorCode: [model.error_msg], //退货原因
       };
       let { addrinfo, wsminfo } = model;
-      //   let arr = []
-      // console.log(addrinfo);
       this.tableForm.product_go = wsminfo;
       this.tableForm.get_product_go = addrinfo;
-
-      // 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() {
       // 重置
@@ -794,8 +782,7 @@ export default {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           console.log(this.sitem);
-          this.outCode = this.sitem.orderCode;
-          // console.log(this.outCode);
+          this.orderCode = this.sitem.orderCode;
           const { info, addrs } = this.sitem;
           info.forEach((ele) => {
             this.noSendNum += ele.wsend_num;
@@ -817,11 +804,10 @@ export default {
             return ele;
           });
           this.tableForm.get_product_go = [].concat(...l_list);
-          // console.log(l_list);
           this.ruleForm = {
-            return_remark: "", //退货备注
+            remark: "", //退货备注
             return_num: "", //退货数量
-            returnReason: [], //退货原因
+            errorCode: "", //退货原因
           };
         }
       });
@@ -853,15 +839,10 @@ export default {
             };
             addr.push(obj);
           });
-          let _model = {
-            orderCode: this.outCode,
-            errorCode: model.returnReason,
-            remark: model.return_remark,
-            list,
-            addr,
-          };
-          console.log(_model);
-          console.log(this.noSendNum);
+          model.list = list;
+          model.addr = addr;
+          model.orderCode = this.orderCode;
+          delete model["get_return_num"];
           if (Number(model.return_num) > Number(this.noSendNum)) {
             this.$message.warning("退货数量不能大于未发货数量");
             return;
@@ -869,9 +850,9 @@ export default {
           let res = {};
           if (this.id === "add") {
             delete model["id"];
-            res = await asyncRequest.add(_model);
+            res = await asyncRequest.add(model);
           } else {
-            res = await asyncRequest.update(_model);
+            res = await asyncRequest.update(model);
           }
           this.loading = false;
           if (res && res.code === 0) {
@@ -899,8 +880,6 @@ export default {
     checkRow(rowIndex, name) {
       if (name == "return") {
         const model = JSON.parse(JSON.stringify(this.ruleForm));
-        console.log(model.return_num);
-        console.log(this.noSendNum);
         if (Number(model.return_num) > Number(this.noSendNum)) {
           this.$message.warning("退货数量不能大于未发货数量");
           return;
@@ -931,9 +910,6 @@ export default {
     },
     //编辑某一行
     editRow(rowIndex, name) {
-      // console.log(this.tableForm.product_go[rowIndex].edit);
-      // console.log(rowIndex);
-      // console.log(this.tableForm.product_go);
       if (name == "return") {
         let index = this.tableForm.product_go.findIndex((v) => {
           v.edit;

+ 4 - 0
src/views/sellOut/salesOrder/columns.js

@@ -13,14 +13,18 @@ export default [
   {
     prop: "good_code",
     label: "商品编码",
+    width:"140"
   },
   {
     prop: "good_name",
     label: "商品名称",
+    width:"150"
   },
   {
     prop: "good_class",
     label: "商品分类",
+    width:"120"
+
   },
 
   {

+ 55 - 122
src/views/sellOut/salesOrder/index.vue

@@ -26,36 +26,17 @@
         <template #table-header="{}">
           <div style="width: 100%">
             <el-row style="padding: 0 0 0 80px">
-              <el-col :span="4" style="width: 120px">
-                <el-dropdown @command="handleClick($event)" :size="searchSize">
-                  <el-button :size="searchSize" style="width: 120px">
-                    {{ sselect }}
-                    <i
-                      class="el-icon-arrow-down el-icon--right"
-                      :size="searchSize"
-                    ></i>
-                  </el-button>
-                  <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item
-                      v-for="item in options"
-                      :key="item"
-                      :command="item"
-                      >{{ item }}</el-dropdown-item
-                    >
-                  </el-dropdown-menu>
-                </el-dropdown>
-              </el-col>
-              <el-col :span="6" style="width: 303px; padding: 0 0 0 10px">
+              <el-col :span="6" style="width: 303px; padding: 0 0 0 0px">
                 <period-date-picker
                   :type="1"
                   :width="'135px'"
                   :size="searchSize"
-                  :start="timeOBJ.start"
-                  :end="timeOBJ.end"
+                  :start="parmValue.start"
+                  :end="parmValue.end"
                   @timeReturned="handleTime"
                 />
               </el-col>
-              <el-col :span="4" style="width: 150px; padding: 0 0 0 10px">
+              <el-col :span="4" style="width: 150px; padding: 0 0 0 0px">
                 <el-select
                   :size="searchSize"
                   v-model="parmValue.status"
@@ -77,28 +58,6 @@
                   />
                 </el-select>
               </el-col>
-              <!-- <el-col :span="4" style="width: 370px; padding: 0 0 0 10px">
-                <search-supplier
-                  :size="searchSize"
-                  :value="parmValue.supplierNo"
-                  :placeholder="'入库公司名称'"
-                  :disabled="false"
-                  :isDetail="false"
-                  @searchChange="supplierChange"
-                />
-              </el-col>
-              <el-col :span="4" style="width: 220px; padding: 0 0 0 10px">
-                <search-stock
-                  :size="searchSize"
-                  :value="parmValue.stockNo"
-                  :placeholder="'入库仓库名称'"
-                  :disabled="false"
-                  :isDetail="false"
-                  :isRelation="true"
-                  :companyCode="supplierNo"
-                  @searchChange="stockChange"
-                />
-              </el-col> -->
               <el-col :span="3" style="width: 66px; float: right">
                 <el-button
                   :size="searchSize"
@@ -113,6 +72,7 @@
             <el-row style="padding: 10px 0 0 0">
               <el-col :span="6" style="width: 500px">
                 <el-input
+                  clearable
                   placeholder="关键字"
                   v-model="input"
                   :size="searchSize"
@@ -124,15 +84,30 @@
                     slot="prepend"
                     placeholder="请选择"
                   >
-                    <el-option label="销售订单编号" value="1"></el-option>
-                    <!-- <el-option label="入库单编号" value="2"></el-option> -->
-                    <!-- <el-option label="备库编号" value="3"></el-option> -->
-                    <el-option label="商品属性编号" value="4"></el-option>
-                    <el-option label="产品名称" value="5"></el-option>
-                    <el-option label="申请人" value="6"></el-option>
-                    <!-- <el-option label="采购供应商编号" value="7"></el-option> -->
+                    <el-option
+                      label="销售订单编号"
+                      value="orderCode"
+                    ></el-option>
+                    <el-option
+                      label="商品属性编号"
+                      value="good_code"
+                    ></el-option>
+                    <el-option
+                      label="供应商编号"
+                      value="supplierNo"
+                    ></el-option>
+                    <el-option
+                      label="客户编号"
+                      value="customer_code"
+                    ></el-option>
+                    <el-option label="产品名称" value="good_name"></el-option>
+                    <el-option label="申请人" value="apply_name"></el-option>
                   </el-select>
-                  <el-button slot="append" icon="el-icon-search"></el-button>
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="searchList"
+                  ></el-button>
                 </el-input>
               </el-col>
 
@@ -174,7 +149,6 @@
             "
           ></el-tag>
         </template>
-        <!-- v-if="powers.some((item) => item == '007')" -->
         <template #operation="{ scope }">
           <el-tooltip effect="dark" content="详情" placement="top">
             <i
@@ -202,7 +176,6 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-// import statusList from "@/assets/js/statusList";
 import asyncRequest from "@/apis/service/sellOut/salesOrder";
 import columns from "./columns"; //表格列参数
 import addEdit from "./components/addEdit";
@@ -231,14 +204,9 @@ export default {
   data() {
     return {
       sitem: null,
-      select: "1",
+      select: "orderCode",
       input: "",
-      timeOBJ: {
-        start: "", //起始时间
-        end: "", // 结束时间
-      },
       options: ["创建时间", "最晚入库时间"],
-      sselect: "创建时间",
       // 状态
       statusOptions: [
         { id: "0", label: "待发起流程" },
@@ -248,36 +216,24 @@ export default {
         { id: "4", label: "待发货完成" },
         { id: "5", label: "发货已完成" },
       ],
-      // statusList: statusList,
       loading: false,
       showModel: false,
       isDetail: false,
       modelId: 0,
       parmValue: {
         order_type: "1", //订单类型1为销售 2为咨询
-        bk_code: "", // 备库编码
-        wsm_in_code: "", // 入库单号
-        cgdNo: "", // 采购单编码
+        orderCode: "", //销售订单code
         apply_name: "", // 申请人
         good_name: "", // 产品名称
         good_code: "", // 产品属性编号
-
         status: "", //状态
-
-        wsm_code: "", //入货仓库编码
-        start: "", //新建起始时间
-        end: "", // 新建结束时间
-        last_start: "", //最后入库时间开始
-        last_end: "", //最后入库时间结束
         page: 1, // 页码
         size: 15, // 每页显示条数
-        supplierNo: "",
-        wsm_supplierNo: "",
+        supplierNo: "", //供应商编号
+        customer_code: "", //客户编号
+        start: "", //新建起始时间
+        end: "", // 新建结束时间
       },
-      tableData: [],
-      passwordModel: false,
-      passwordModelId: 0,
-      isPasswordDetail: false,
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
@@ -302,30 +258,22 @@ export default {
 
   methods: {
     restSearch() {
-      this.sselect = "创建时间";
-      this.select = "1";
+      this.select = "orderCode";
       this.input = "";
-      this.timeOBJ = {
-        start: "", //起始时间
-        end: "", // 结束时间
-      };
+
       this.parmValue = {
         order_type: "1", //订单类型1为销售 2为咨询
-
-        bk_code: "", // 备库编码
-        wsm_in_code: "", // 入库单号
-        cgdNo: "", // 采购单编码
+        orderCode: "", //销售订单code
         apply_name: "", // 申请人
         good_name: "", // 产品名称
         good_code: "", // 产品属性编号
         status: "", //状态
-        wsm_code: "", //入货仓库编码
-        start: "", //新建起始时间
-        end: "", // 新建结束时间
-        last_start: "", //最后入库时间开始
-        last_end: "", //最后入库时间结束
         page: 1, // 页码
         size: 15, // 每页显示条数
+        supplierNo: "", //供应商编号
+        customer_code: "", //客户编号
+        start: "", //新建起始时间
+        end: "", // 新建结束时间
       };
       // 表格 - 分页
       this.pageInfo = {
@@ -335,23 +283,6 @@ export default {
       };
       this.searchList();
     },
-    async handleClick(e) {
-      this.sselect = e;
-      this.parmValue.start = e === "创建时间" ? this.timeOBJ.start : "";
-      this.parmValue.end = e === "创建时间" ? this.timeOBJ.end : "";
-      this.parmValue.last_start = e !== "创建时间" ? this.timeOBJ.start : "";
-      this.parmValue.last_end = e !== "创建时间" ? this.timeOBJ.end : "";
-      if (
-        !(
-          (this.timeOBJ.start !== "" && this.timeOBJ.end === "") ||
-          (this.timeOBJ.start === "" && this.timeOBJ.end !== "")
-        )
-      ) {
-        this.parmValue.page = 1;
-        this.pageInfo.curr = 1;
-        await this.searchList();
-      }
-    },
     openModal(id, isDetail, sitem) {
       this.modelId = id;
       this.isDetail = isDetail;
@@ -385,14 +316,17 @@ export default {
     },
     async searchList() {
       this.loading = true;
-      this.parmValue.cgdNo = this.select === "1" ? this.input : ""; // 采购单编码
-      this.parmValue.wsm_in_code = this.select === "2" ? this.input : ""; // 入库单号
-      this.parmValue.bk_code = this.select === "3" ? this.input : ""; // 备库编码
-      this.parmValue.good_code = this.select === "4" ? this.input : ""; // 产品属性编号
-      this.parmValue.good_name = this.select === "5" ? this.input : ""; // 产品名称
-      this.parmValue.apply_name = this.select === "6" ? this.input : ""; // 申请人
-      this.parmValue.supplierNo = this.select === "7" ? this.input : ""; // 采购供应商编号
+      this.parmValue.orderCode = this.select === "orderCode" ? this.input : ""; // 采购单编码
+      this.parmValue.good_code = this.select === "good_code" ? this.input : ""; // 入库单号
+      this.parmValue.supplierNo =
+        this.select === "supplierNo" ? this.input : ""; // 产品属性编号
+      this.parmValue.customer_code =
+        this.select === "customer_code" ? this.input : ""; // 产品名称
+      this.parmValue.good_name = this.select === "good_name" ? this.input : ""; // 申请人
+      this.parmValue.apply_name =
+        this.select === "apply_name" ? this.input : ""; // 采购供应商编号
       this.parmValue.order_type = "1"; //订单类型1为销售订单 2为咨询订单
+      console.log(this.parmValue);
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
@@ -417,16 +351,15 @@ export default {
     // 时间
     async handleTime(e) {
       if (e.startTime !== "") {
-        this.timeOBJ.start = e.startTime;
+        this.parmValue.start = e.startTime;
       } else {
-        this.timeOBJ.start = "";
+        this.parmValue.start = "";
       }
       if (e.endTime !== "") {
-        this.timeOBJ.end = e.endTime;
+        this.parmValue.end = e.endTime;
       } else {
-        this.timeOBJ.end = "";
+        this.parmValue.end = "";
       }
-      await this.handleClick(this.sselect);
     },
   },
 };

+ 83 - 124
src/views/sellOut/sellAfterApply/components/addEditForm.vue

@@ -10,24 +10,24 @@
     class="demo-ruleForm"
   >
     <!-- <p>orderCode{{ sitem }}</p> -->
-
+    <p>disabled{{ disabled }}</p>
     <el-row>
       <el-row>
         <el-col :span="12">
-          <el-form-item label="异常数量" prop="anomalous_numbers">
+          <el-form-item label="异常数量" prop="error_num">
             <el-input
               :disabled="disabled"
-              v-model="ruleForm.anomalous_numbers"
+              v-model="ruleForm.error_num"
               placeholder="请输入异常数量"
             ></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="异常原因" prop="anomalous_reason">
+          <el-form-item label="异常原因" prop="error_code">
             <el-select
               style="width: 100%"
               :disabled="disabled"
-              v-model="ruleForm.anomalous_reason"
+              v-model="ruleForm.error_code"
               placeholder="请选择异常原因"
             >
               <el-option
@@ -42,11 +42,11 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="期望意愿" prop="expect_wish">
+          <el-form-item label="期望意愿" prop="except_code">
             <el-select
               style="width: 100%"
               :disabled="disabled"
-              v-model="ruleForm.expect_wish"
+              v-model="ruleForm.except_code"
               placeholder="请选择期望意愿"
             >
               <el-option
@@ -60,11 +60,11 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="异常备注" prop="anomalous_remark">
+          <el-form-item label="异常备注" prop="error_remark">
             <el-input
               type="textarea"
               placeholder="请输入异常原因备注"
-              v-model="ruleForm.anomalous_remark"
+              v-model="ruleForm.error_remark"
               :disabled="disabled"
               maxlength="250"
               show-word-limit
@@ -74,23 +74,27 @@
       </el-row>
 
       <el-col :span="24">
-        <el-form-item label="异常图片" prop="anomalous_images">
+        <el-form-item label="异常图片" prop="error_img">
           <div class="el-form-item-error-img">
             <ul>
               <li
                 class="images_li"
                 :style="getMargin_li()"
-                v-for="(item, index) in ruleForm.anomalous_images"
+                v-for="(item, index) in ruleForm.error_img"
                 :key="item"
               >
                 <img :src="item" alt="" style="width: 254px; height: 164px" />
-                <i class="el-icon-close" @click="imgClose(index)"></i>
+                <i
+                  class="el-icon-close"
+                  @click="imgClose(index)"
+                  v-if="!disabled"
+                ></i>
               </li>
             </ul>
             <div
               class="btnupload"
               :style="getMargin()"
-              v-if="ruleForm.anomalous_images.length < 5 && isShow"
+              v-if="ruleForm.error_img.length < 5 && isShow"
               style="position: relative"
               @click="open"
             >
@@ -107,7 +111,6 @@
           </div>
         </el-form-item>
       </el-col>
-
       <el-col :span="24" style="text-align: right">
         <el-button
           type="primary"
@@ -119,34 +122,14 @@
           >保 存</el-button
         >
         <el-button
-          type="primary"
-          @click="statusConfirm('1', '发起审核流程')"
-          v-if="status === '0' && powers.some((item) => item == '012')"
-          >发起审核流程
-        </el-button>
-        <el-button
-          @click="statusConfirm('0', '取消审核流程')"
-          plain
-          v-if="status === '1' && powers.some((item) => item == '014')"
-          >取消审核流程</el-button
-        >
-        <el-button
-          @click="statusConfirm('-1', '作废该条信息')"
-          type="danger"
-          plain
+          @click="closeAddEdit"
           v-if="
-            (status === '0' || status === '1') &&
-            powers.some((item) => item == '015')
+            id === 'add' ||
+            (status === '0' && powers.some((item) => item == '005'))
           "
-          >作废该条信息</el-button
-        >
-        <el-button
-          @click="statusConfirm('2', '通过审核')"
-          type="primary"
-          v-if="status === '1' && powers.some((item) => item == '016')"
-          >通过审核</el-button
-        >
-      </el-col>
+          >{{ isDetail ? "关 闭" : "取 消" }}</el-button
+        ></el-col
+      >
     </el-row>
   </el-form>
 </template>
@@ -155,7 +138,7 @@ import { isnumber } from "@/utils/validate.js";
 import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
 import resToken from "@/mixins/resToken";
 export default {
-  name: "handover",
+  name: "sellAfterApplyDetail",
   props: ["id", "sitem", "showModelThis", "newTime", "orderCode", "outCode"],
   mixins: [resToken],
   data() {
@@ -180,39 +163,38 @@ export default {
       hand_name: "", //交接人
       ruleForm: {
         order_type: "1", //售后类型 1销售2咨询,
-        outCode: "", //
-        stock_out_numbers: "", //出库单编号
-        anomalous_numbers: "", //异常数量
-        anomalous_reason: "", //异常原因
-        expect_wish: "", //期望意愿
-        anomalous_images: [],
-        anomalous_remark: "", //异常备注
+        outCode: "", //出库单编号
+        error_num: "", //异常数量
+        error_img: [], //异常图片
+        error_remark: "", //异常备注
+        error_code: "", //异常原因code
+        except_code: [], //期望意愿
       },
       rulesThis: this.rules,
       // 验证规则
       rules: {
-        anomalous_numbers: [
+        error_num: [
           {
             required: true,
             trigger: "blur",
             validator: validatenumbers,
           },
         ],
-        anomalous_reason: [
+        error_code: [
           {
             required: true,
             message: "请选择异常原因",
             trigger: "change",
           },
         ],
-        expect_wish: [
+        except_code: [
           {
             required: true,
             message: "请选择期望意愿",
             trigger: "change",
           },
         ],
-        anomalous_images: [
+        error_img: [
           {
             type: "array",
             required: true,
@@ -220,7 +202,7 @@ export default {
             trigger: "change",
           },
         ],
-        anomalous_remark: [
+        error_remark: [
           {
             required: true,
             message: "请输入异常原因备注",
@@ -244,7 +226,6 @@ export default {
           label: "接受差异改变售价",
         },
       ],
-      expect_value: "", //期望意愿
       code: "",
     };
   },
@@ -252,7 +233,7 @@ export default {
     powers() {
       let tran =
         this.$store.getters.btnList.find(
-          (item) => item.menu_route == "handoverDetail"
+          (item) => item.menu_route == "sellAfterApplyDetail"
         ) || {};
       if (tran && tran.action && tran.action.length > 0) {
         return tran.action;
@@ -279,10 +260,9 @@ export default {
   },
   methods: {
     //   关闭弹窗,直接隐藏表单
-    // async closeAddEdit() {
-    //   this.$emit("closeModel", false); //抛出一个事件,关闭弹窗
-    //
-    // },
+    async closeAddEdit() {
+      this.$emit("closeModel", false); //抛出一个事件,关闭弹窗
+    },
     closeAdd() {
       this.showModelThis = false;
     },
@@ -304,58 +284,41 @@ export default {
       this.loading = false;
     },
     async initData() {
-      console.log(this.sitem);
       if (this.sitem) {
-        let { returnCode } = this.sitem;
-        let model = {
-          returnCode,
+        const {
+          error_num,
+          error_img,
+          error_remark,
+          except_code,
+          error_code,
+          outCode,
+        } = this.sitem;
+        console.log(this.sitem);
+        this.ruleForm = {
+          outCode: outCode, //出库单编号
+          error_num: error_num, //异常数量
+          error_code: error_code, //异常原因
+          except_code: except_code, //期望意愿
+          error_img: error_img.split(","),
+          error_remark: error_remark, //异常备注
         };
-        const res = await asyncRequest.detail(model);
-        if (res && res.code === 0 && res.data) {
-          let { error_num, error_img, error_remark, except_code, error_code } =
-            res.data;
-          console.log(res.data);
-          this.ruleForm = {
-            stock_out_numbers: "", //出库单编号
-            anomalous_numbers: error_num, //异常数量
-            anomalous_reason: error_code, //异常原因
-            expect_wish: except_code, //期望意愿
-            anomalous_images: [error_img],
-            anomalous_remark: error_remark, //异常备注
-          };
-        } else if (res && res.code >= 100 && res.code <= 104) {
-          await this.logout();
-        } else {
-          this.$message.warning(res.message);
-        }
       }
     },
-
     async resetForm() {
-      this.resign_name = "";
-      this.hand_name = "";
-      this.status = "";
       // 重置
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          // console.log(this.sitem);
-          // let { outCode } = this.sitem;
-          // this.code = outCode;
-          // if (this.id === "add") {
-          // let OutCode = "";
-          // bum.map((ele) => {
-          //   OutCode = ele.outCode;
-          // });
           this.ruleForm = {
-            anomalous_numbers: "", //异常数量
-            anomalous_reason: "", //异常原因
-            expect_wish: "", //期望意愿
-            anomalous_images: [],
-            outCode: this.code,
+            order_type: "1", //售后类型 1销售2咨询,
+            outCode: "", //出库单编号
+            error_num: "", //异常数量
+            error_img: [], //异常图片
+            error_remark: "", //异常备注
+            error_code: "", //异常原因code
+            except_code: "", //期望意愿
           };
-          // }
         }
       });
     },
@@ -368,22 +331,19 @@ export default {
             return false;
           }
           let model = JSON.parse(JSON.stringify(this.ruleForm));
-          console.log(model);
-          // console.log("调接口");
-          let _model = {
-            order_type: "1",
-            outCode: this.sitem.outCode,
-            orderCode: this.sitem.orderCode,
+          model.error_img = model.error_img.toString();
+          model.outCode = this.sitem.outCode;
+          model.orderCode = this.sitem.orderCode;
+          model.num = model.error_num;
+          model.remark = model.error_remark;
+          model.img = model.error_img;
+          model.errorCode = model.error_code;
+          delete model["error_num"];
+          delete model["error_remark"];
+          delete model["error_img"];
+          delete model["error_code"];
 
-            errorCode: model.anomalous_reason, //异常原因
-            num: model.anomalous_numbers,
-            remark: model.anomalous_remark,
-            except_code: model.expect_wish,
-            img: model.anomalous_images.toString(),
-          };
-
-          console.log(_model);
-          const res = await asyncRequest.add(_model);
+          const res = await asyncRequest.add(model);
 
           if (res && res.code === 0) {
             const title = this.id === "add" ? "添加成功!" : "修改成功!";
@@ -492,20 +452,20 @@ export default {
       } else {
         this.ruleForm.anomalous_reason = "";
       }
-      this.$refs.ruleForm.validateField("company_img");
+      this.$refs.ruleForm.validateField("error_code");
     },
     //图片上传失败
     UploadErrorEvent() {
       this.$message.error("图片上传失败!");
-      this.$refs.ruleForm.validateField("anomalous_images");
+      this.$refs.ruleForm.validateField("error_img");
     },
     //图片上传成功
     UploadSuccessEvent(data) {
       if (data && data.url && data.url !== "break") {
         const { url } = data.url;
-        this.ruleForm.anomalous_images.push(url);
+        this.ruleForm.error_img.push(url);
         this.$message.success("图片上传成功!");
-        this.$refs.ruleForm.validateField("anomalous_images");
+        this.$refs.ruleForm.validateField("error_img");
       }
     },
     //判断图片规格
@@ -529,24 +489,23 @@ export default {
           this.$message.error("图片大小不能超过 1MB!");
         }
       }
-
       return isJPG && isLt2M;
     },
     imgClose(index) {
-      this.ruleForm.anomalous_images.splice(index, 1);
-      this.$refs.ruleForm.validateField("anomalous_images");
+      this.ruleForm.error_img.splice(index, 1);
+      this.$refs.ruleForm.validateField("error_img");
     },
     getMargin() {
-      if (this.ruleForm.anomalous_images.length == 0) {
+      if (this.ruleForm.error_img.length == 0) {
         return "margin:0;";
-      } else if (this.ruleForm.anomalous_images.length < 3) {
+      } else if (this.ruleForm.error_img.length < 3) {
         return "margin:0px 0 0 10px";
       } else {
         return "margin:10px 0 0 10px";
       }
     },
     getMargin_li() {
-      if (this.ruleForm.anomalous_images.length <= 3) {
+      if (this.ruleForm.error_img.length <= 3) {
         return "margin:0 0 0 10px";
       } else {
         return "margin:10px 0 0 10px";

+ 26 - 72
src/views/sellOut/sellAfterApply/components/returnExpress.vue

@@ -9,14 +9,14 @@
     style="width: 100%"
     class="demo-ruleForm"
   >
-    {{ returnCode }}
+    <p>退货单号{{ returnCode }}</p>
     <el-row>
       <el-col :span="12">
-        <el-form-item label="费用承担方" prop="express_bear">
+        <el-form-item label="费用承担方" prop="own">
           <el-select
             clearable
             @change="handleChange"
-            v-model="ruleForm.express_bear"
+            v-model="ruleForm.own"
             placeholder="请选择"
             style="width: 100%"
           >
@@ -41,56 +41,26 @@
         </el-form-item>
       </el-col>
       <el-col :span="12">
-        <el-form-item label="物流单号" prop="express_numbres">
+        <el-form-item label="物流单号" prop="post_code">
           <el-input
             placeholder="请输入物流单号"
-            v-model="ruleForm.express_numbres"
+            v-model="ruleForm.post_code"
           ></el-input>
         </el-form-item>
       </el-col>
       <el-col :span="12" v-if="isShow">
-        <el-form-item label="物流费用" prop="express_fee">
-          <el-input placeholder="请输入物流费用" v-model="ruleForm.express_fee">
+        <el-form-item label="物流费用" prop="post_fee">
+          <el-input placeholder="请输入物流费用" v-model="ruleForm.post_fee">
             <template slot="append">元</template>
           </el-input>
         </el-form-item>
       </el-col>
     </el-row>
     <el-row>
-      <el-col :span="24" style="text-align: right">
-        <el-button type="primary" @click="submitForm" v-if="true"
+      <el-col :span="24" style="text-align: right; margin: 0 0 10px 0">
+        <el-button type="primary" @click="submitForm" v-if="true" size="mini"
           >保 存</el-button
         >
-        <!-- id === 'add' ||
-            (status === '0' && powers.some((item) => item == '005')) -->
-        <el-button
-          type="primary"
-          @click="statusConfirm('1', '发起审核流程')"
-          v-if="status === '0' && powers.some((item) => item == '012')"
-          >发起审核流程
-        </el-button>
-        <el-button
-          @click="statusConfirm('0', '取消审核流程')"
-          plain
-          v-if="status === '1' && powers.some((item) => item == '014')"
-          >取消审核流程</el-button
-        >
-        <el-button
-          @click="statusConfirm('-1', '作废该条信息')"
-          type="danger"
-          plain
-          v-if="
-            (status === '0' || status === '1') &&
-            powers.some((item) => item == '015')
-          "
-          >作废该条信息</el-button
-        >
-        <el-button
-          @click="statusConfirm('2', '通过审核')"
-          type="primary"
-          v-if="status === '1' && powers.some((item) => item == '016')"
-          >通过审核</el-button
-        >
       </el-col>
     </el-row>
   </el-form>
@@ -136,10 +106,6 @@ export default {
           value: "2",
           label: "公司承担",
         },
-        {
-          value: "3",
-          label: "供应商承担",
-        },
       ],
       code: "",
       isShow: false,
@@ -149,21 +115,17 @@ export default {
       resign_name: "", //离职人
       hand_name: "", //交接人
       ruleForm: {
-        post_company: "", //入参快递公司
-
-        express_bear: "", //物流费用承担方
+        company: "", //入参快递公司
+        own: "", //物流费用承担方
         express_company: [], //物流公司
-        express_numbres: "", //物流单号
-        express_fee: 0, //物流费用
-        page: 1,
-        size: 15,
+        post_code: "", //物流单号
+        post_fee: 0, //物流费用
       },
       rulesThis: this.rules,
       // 验证规则
       rules: {
-        express_bear: [
+        own: [
           {
-            // type: "array",
             required: true,
             trigger: "change",
             message: "请选择物流费用承担方",
@@ -177,14 +139,14 @@ export default {
             message: "请选择退回仓库",
           },
         ],
-        express_numbres: [
+        post_code: [
           {
             required: true,
             trigger: "blur",
             validator: validateexpress,
           },
         ],
-        express_fee: [
+        post_fee: [
           {
             required: true,
             trigger: "blur",
@@ -257,13 +219,11 @@ export default {
           this.$refs.ruleForm.clearValidate();
           this.code = this.returnCode;
           this.ruleForm = {
-            express_bear: "",
-            post_company: "", //入参快递公司
+            own: "",
+            company: "", //入参快递公司
             express_company: [], //物流公司
-            express_numbres: "", //物流单号
-            express_fee: 0, //物流费用
-            type: "",
-            name: "",
+            post_code: "", //物流单号
+            post_fee: 0, //物流费用
           };
         }
       });
@@ -273,22 +233,16 @@ export default {
         if (valid) {
           console.log(this.ruleForm);
           let model = JSON.parse(JSON.stringify(this.ruleForm));
-          let _model = {
-            returnCode: this.code, //退货单号
-            own: model.express_bear, //费用承担方
-            company: model.post_company, //快递公司
-            post_code: model.express_numbres, //快递编号
-            post_fee: model.express_fee || 0, //快递费用
-          };
-          const res = await asyncRequest.afterPost(_model);
+          model.returnCode = this.code;
+          delete model["express_company"];
+          // console.log(model);
+          const res = await asyncRequest.afterPost(model); //售后快递录入
           this.loading = false;
           if (res && res.code === 0) {
-            // const title = this.id === "add" ? "添加成功!" : "修改成功!";
             this.$notify.success({
               title: res.message,
               message: "",
             });
-            console.log("抛出事件");
             this.$emit("refresh");
           } else if (res && res.code >= 100 && res.code <= 104) {
             await this.logout();
@@ -304,9 +258,9 @@ export default {
     handleCompany(e) {
       console.log(e);
       if (e && e.code) {
-        this.ruleForm.post_company = e.shortName;
+        this.ruleForm.company = e.shortName;
         this.ruleForm.express_company = [e.code];
-        this.ruleForm.page = 1;
+        // this.ruleForm.page = 1;
       }
       console.log(this.ruleForm.express_company);
     },

+ 2 - 26
src/views/sellOut/sellAfterApply/index.vue

@@ -3,9 +3,8 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <!-- v-loading="loading" -->
       <ex-table
-        v-loading="false"
+        v-loading="loading"
         :table="table"
         :data="tableData"
         :columns="columns"
@@ -65,20 +64,6 @@
                     @searchChange="customerChange"
                   />
                 </el-col>
-
-                <!-- 申请人 -->
-
-                <!-- <el-col :span="3" style="width: 66px; float: right">
-                  <el-button
-                    :size="searchSize"
-                    type="primary"
-                    style="float: right; margin-left: 5px"
-                    @click="openModal('add', false)"
-                  >
-                    新建
-                  </el-button>
-                </el-col> -->
-
                 <el-col :span="3" style="width: 66px; float: right">
                   <el-button
                     :size="searchSize"
@@ -149,15 +134,6 @@
                   ></el-button>
                 </el-input>
               </el-col>
-
-              <!-- <el-col :span="4" style="width: 54px">
-                <el-button
-                  :size="searchSize"
-                  type="primary"
-                  class="fr"
-                  icon="el-icon-search"
-                  @click="searchList"
-              /></el-col> -->
               <el-col :span="4" style="width: 66px">
                 <el-button
                   type="warning"
@@ -302,7 +278,7 @@ export default {
         { id: "5", label: "待客户验收" },
       ],
       statusList: statusList,
-      loading: true,
+      loading: false,
       showModel: false,
       isDetail: false,
       modelId: 0,

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

@@ -201,19 +201,16 @@ export default {
       if (res && res.code === 0 && res.data) {
         this.s_status = res.data.status;
         console.log(this.s_status);
-        // console.log(res.data);
         this.sitem = res.data;
-        // console.log(this.sitem);
         this.orderCode = res.data.returnCode;
-        // console.log(this.orderCode);
         this.getNewTime();
         if (type) {
-          this.$confirm("这是一段内容", "标题名称", {
+          this.$confirm("是否要跳转到销售售后退货单界面?", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
           })
             .then(() => {
-              console.log(this.routeGoto);
+              this.routeGoto("/sellOut/returnOrder");
             })
             .catch(() => {
               console.log("取消");

+ 8 - 1
src/views/sellOut/sellReturnList/columns.js

@@ -66,4 +66,11 @@ export default [
           _slot_: "operation",
         },
       
-]
+]
+// page	是	string	页码
+// size	是	string	页码数
+// cgdNo	是	string	采购单编号
+// returnCode	是	string	退货单编号
+// good_type_code	是	string	商品属性
+// good_name	是	string	商品名称
+// status	是	string	状态

+ 0 - 1
src/views/sellOut/sellReturnList/components/returnCheck.vue

@@ -9,7 +9,6 @@
     style="width: 100%"
     class="demo-ruleForm"
   >
-    <p>sitem{{ sitem }}</p>
     <el-row>
       <el-row>
         <!-- 收货商品数量 getGoods_numbers-->

+ 8 - 84
src/views/sellOut/sellReturnList/detail.vue

@@ -1,23 +1,18 @@
 <template>
   <div class="noSendDetail pagePadding">
+    <p>status{{ status }}</p>
     <div
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <!-- <p>noSendDetail</p>
-      <p>sellReturnDetail页面{{ powers }}</p>
-      <p>status{{ status }}</p>
-      <p>{{ qid }}</p> -->
-      <!-- <p>{{ sitem }}</p> -->
-      <!-- <p>{{ newTime }}</p> -->
       <el-button
         style="margin: 20px 0 20px 0"
         type="primary"
         plain
         :size="'mini'"
-        @click="statusConfirm('1', '发起审核流程', '')"
+        @click="statusConfirm('1', '发起退货流程', '')"
         v-if="status === '0' && powers.some((item) => item == '012')"
-        >发起审核流程
+        >发起退货流程
       </el-button>
       <el-button
         type="danger"
@@ -27,14 +22,6 @@
         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"
@@ -57,7 +44,7 @@
         >
           {{ status }}
           <exam-form
-            v-if="status == '1'"
+            v-if="status === '1'"
             :statusList="statusList"
             :newTime="newTime"
             :disabled="false"
@@ -68,7 +55,7 @@
         <el-collapse-item
           title="通知库管"
           name="1"
-          v-if="powers.some((item) => item == '037')"
+          v-if="powers.some((item) => item == '037') && status === '2'"
         >
           <div
             style="height: 60px; padding: 20px 0 0px 0"
@@ -86,7 +73,7 @@
         <el-collapse-item
           title="通知采购部门"
           name="1"
-          v-if="powers.some((item) => item == '038')"
+          v-if="powers.some((item) => item == '038') && status === '3'"
         >
           <div
             style="height: 60px; padding: 20px 0 0px 0"
@@ -104,7 +91,7 @@
         <el-collapse-item
           title="通知财务部门"
           name="1"
-          v-if="powers.some((item) => item == '039')"
+          v-if="powers.some((item) => item == '039') && status === '4'"
         >
           <div
             style="height: 60px; padding: 20px 0 0px 0"
@@ -128,7 +115,6 @@
           />
         </el-collapse-item>
       </el-collapse>
-      <!-- {{ newTime }} -->
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -139,14 +125,12 @@
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/sellReturnList";
-// import ReturnRecord from "./components/return-record.vue";
 import ReturnCheck from "./components/returnCheck.vue";
 import addEditForm from "@/views/sellOut/salesOrder/addEditForm";
 export default {
   name: "noSendDetail",
   mixins: [mixinPage, resToken],
   components: {
-    // ReturnRecord,
     addEditForm,
     ReturnCheck,
   },
@@ -168,17 +152,10 @@ export default {
       statusOptions: [
         { value: "0", label: "发起退货流程" },
         { value: "1", label: "退货业务审核" },
-        // { value: "2", label: "反馈物流费" },
         { value: "2", label: "通知库管" },
         { value: "3", label: "通知采购" },
         { value: "4", label: "通知财务部门" },
         { value: "5", label: "退货完成" },
-
-        // { id: "0", label: "待申请" },
-        // { id: "1", label: "待验收" },
-        // { id: "2", label: "待验收审核" },
-        // { id: "3", label: "待业务审核" },
-        // { id: "4", label: "完成退货" },
       ],
       s_sitem: null, //传给组件
       // --
@@ -207,7 +184,6 @@ export default {
   },
   mounted() {
     this.qid = this.$route.query.id;
-    // console.log(this.sitem);
     this.initData();
   },
   methods: {
@@ -244,12 +220,6 @@ export default {
     },
     //
     async setstatus(type, message, remark = "") {
-      // await this.$confirm(`确定要${type === "2" ? "同意" : "驳回"}?`, {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // });
-      // .then(async () => {
       console.log(type);
       console.log(remark);
       let _model = {
@@ -270,19 +240,9 @@ export default {
       } else {
         this.$message.warning(res.message);
       }
-      // })
-      // .catch(() => {
-      //   console.log("取消");
-      // });
     },
     async initData() {
-      // console.log(this.sitem);
-      // if (this.sitem) {
-      // let { thNo } = this.sitem;
-      let model = {
-        returnCode: this.qid,
-      };
-      const res = await asyncRequest.detail(model);
+      const res = await asyncRequest.detail({ returnCode: this.qid });
       if (res && res.code === 0 && res.data) {
         this.status = res.data.status;
         this.s_sitem = res.data;
@@ -294,43 +254,7 @@ export default {
       } else {
         this.$message.warning(res.message);
       }
-      // }
     },
-    // changeStatus(status) {
-    //   this.$confirm("确定我已知晓并同意??", {
-    //     confirmButtonText: "确定",
-    //     cancelButtonText: "取消",
-    //     type: "warning",
-    //   })
-    //     .then(async () => {
-    //       // this.$message({
-    //       //   type: "success",
-    //       //   message: "删除成功!",
-    //       // });
-    //       let _model = {
-    //         returnCode: this.qid,
-    //         status: status,
-    //       };
-    //       let res = await asyncRequest.status(_model);
-    //       if (res && res.code === 0) {
-    //         this.$notify.success({
-    //           title: res.message,
-    //           message: "",
-    //         });
-    //         await this.initData();
-    //       } else if (res && res.code >= 100 && res.code <= 104) {
-    //         await this.logout();
-    //       } else {
-    //         this.$message.warning(res.message);
-    //       }
-    //     })
-    //     .catch(() => {
-    //       this.$message({
-    //         type: "info",
-    //         message: "已取消删除",
-    //       });
-    //     });
-    // },
   },
 };
 </script>

+ 8 - 10
src/views/sellOut/sellReturnList/index.vue

@@ -3,10 +3,8 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <!-- loading -->
-      powers:{{ powers }}
       <ex-table
-        v-loading="false"
+        v-loading="loading"
         :table="table"
         :data="tableData"
         :columns="columns"
@@ -210,14 +208,14 @@
           </el-tooltip>
         </template>
       </ex-table>
-      <add-edit
+      <!-- <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>
@@ -229,15 +227,15 @@ import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import columns from "./columns";
 import asyncRequest from "@/apis/service/sellOut/sellReturnList";
-import addEdit from "./addEdit";
+// import addEdit from "./addEdit";
 import { mapGetters } from "vuex";
 
 export default {
   name: "sellReturnList",
   mixins: [mixinPage, resToken],
-  components: {
-    addEdit,
-  },
+  // components: {
+  //   addEdit,
+  // },
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -267,7 +265,7 @@ export default {
         { id: "4", label: "待通知财务" },
         { id: "5", label: "完成退货" },
       ],
-      loading: true,
+      loading: false,
       showModel: false,
       isDetail: false,
       modelId: 0,