Browse Source

feat(退货):静态审核节点

snow 2 years ago
parent
commit
83d34a05f1

+ 1 - 0
src/apis/user/axios.js

@@ -67,6 +67,7 @@ axios.interceptors.request.use(
     }
     const { noRelation, needRela, relaComNo } = config.data
     const innerRelaComNo = store.state.user.currentCompany
+
     // 决定传递关联公司:非超管用户且单独的请求中data中没有设置noRelation
     // needRela: 超管需要传递关联公司(默认超管不传递)
     // noRelation: 普通用户不传递关联公司(默认普通用户传递)

+ 2 - 6
src/views/sellOut/sellAfterApply/components/set-work-order.vue

@@ -66,13 +66,10 @@ export default {
   mixins: [resToken, companyHelper],
   props: ['sitem'],
   data: () => ({
-    list: [
-      { wsmCode: '', num: 0 }
-    ]
+    list: [{ wsmCode: '', num: 0 }]
   }),
   methods: {
-    onStockChange(e, index) {
-      const { code } = e
+    onStockChange({ code } = {}, index) {
       this.$set(this.list, index, {
         ...this.list[index],
         wsmCode: code ? [code] : ''
@@ -80,7 +77,6 @@ export default {
     },
     onNumberChange(num, index) {
       this.$set(this.list, index, {
-        ...this.list[index],
         num
       })
     }

+ 3 - 73
src/views/sellOut/sellReturn/detail.vue

@@ -145,18 +145,8 @@
                 :iscgd="false"
               />
             </el-collapse-item>
-            <!-- newTime !== '' &&
-                sitem &&
-                !(
-                  (sitem.order_type + '' === '1' || sitem.order_type + '' === '2') &&
-                  is_stock + '' === '1'
-                ) &&
-                ppowers.some((i) => i == '1') && -->
-            <el-collapse-item
-              title="业务审核"
-              name="3"
-              v-if="hasPermission({status:'1', process:'1'})"
-            >
+ 
+            <el-collapse-item title="业务审核" name="3" v-if="hasPermission({status:'1', process:'1'})">
               <exam-form
                 v-if="newTime"
                 :statusList="statusList"
@@ -167,18 +157,7 @@
               />
             </el-collapse-item>
 
-            <!-- newTime !== '' &&
-                sitem &&
-                !(
-                  (sitem.order_type + '' === '1' || sitem.order_type + '' === '2') &&
-                  is_stock + '' === '1'
-                ) &&
-                ppowers.some((i) => i == '1') && -->
-            <el-collapse-item
-              title="供应商审核"
-              name="4"
-              v-if="hasPermission({status:'9', process:'9'})"
-            >
+            <el-collapse-item title="供应商审核" name="4" v-if="hasPermission({status:'9', process:'9'})">
               <exam-form
                 v-if="newTime"
                 :statusList="statusList"
@@ -208,55 +187,6 @@
               <set-work-order :sitem="sitem" />
             </el-collapse-item>
 
-            <!-- <el-collapse-item
-              title="采购专员审批"
-              name="4"
-              v-if="
-                sitem &&
-                (status + '' === '4' || status + '' === '3' || status + '' === '2') &&
-                !(
-                  ((sitem && sitem.order_type + '' === '1') || sitem.order_type + '' === '2') &&
-                  is_stock + '' === '1'
-                )
-              "
-            >
-              <com-exam-form
-                v-if="newTime"
-                :statusList="statusList"
-                :newTime="newTime"
-                :sitem="sitem"
-                :disabled="
-                  status + '' === '4' ||
-                  status + '' === '3' ||
-                  !(ppowers.some((i) => i == '2') && status + '' === '2')
-                "
-                :isMust="false"
-                @refresh="initData"
-              />
-            </el-collapse-item> -->
-            <!-- 
-            <el-collapse-item
-              title="采购主管审批"
-              name="5"
-              v-if="
-                sitem &&
-                ppowers.some((i) => i == '3') &&
-                status + '' === '3' &&
-                !(
-                  (sitem.order_type + '' === '1' || sitem.order_type + '' === '2') &&
-                  is_stock + '' === '1'
-                )
-              "
-            >
-              <exam-form
-                v-if="newTime"
-                :statusList="statusList"
-                :newTime="newTime"
-                :disabled="false"
-                :isMust="false"
-                @searchChange="dirExamForm"
-              />
-            </el-collapse-item> -->
           </el-collapse>
         </el-tab-pane>
         <el-tab-pane label="审批记录" name="2">

+ 0 - 1
src/views/sellOut/sellReturn/index.vue

@@ -271,7 +271,6 @@ import urlConfig from "@/apis/url-config";
 import { xs_order_type_options ,xs_order_source_options} from "@/assets/js/statusList";
 import companyHelper from "@/mixins/companyHelper"
 
-
 export default {
   name: "sellReturn",
   mixins: [mixinPage, resToken, companyHelper],

+ 106 - 0
src/views/supplierSellOut/supplierReturnWorkOrder/columns.js

@@ -0,0 +1,106 @@
+export default [
+  { type: 'selection', fixed: 'left', _noset_: true },
+  {
+    prop: 'outChildCode',
+    label: '退货工单编号',
+    width: '160'
+  },
+  {
+    prop: 'orderCode',
+    label: '工单退货类型',
+    width: '160'
+  },
+  {
+    prop: 'outCode',
+    label: '退货流程编码',
+    width: '160'
+  },
+  {
+    prop: 'companyNo',
+    label: '业务公司编号',
+    width: '160'
+  },
+  {
+    prop: 'companyName',
+    label: '发货工单编号',
+    width: '160'
+  },
+  {
+    prop: 'customer_code',
+    label: '业务公司编码',
+    width: '160'
+  },
+  {
+    prop: 'customer_name',
+    label: '业务公司名称',
+    width: '160'
+  },
+  {
+    prop: 'supplierNo',
+    label: '客户编码 ',
+    width: '160'
+  },
+  {
+    prop: 'supplierName',
+    label: '客户名称',
+    width: '160'
+  },
+  {
+    prop: 'supplierNo',
+    label: '下单数量 ',
+    width: '160'
+  },
+  {
+    prop: 'spuCode',
+    label: '商品成本编码',
+    width: '160'
+  },
+  {
+    prop: 'skuCode',
+    label: '销售单价',
+    width: '160'
+  },
+
+  {
+    prop: 'order_type',
+    label: '销售合计',
+    width: '85'
+  },
+  {
+    prop: 'order_source',
+    label: '确认单状态',
+    width: '85'
+  },
+  {
+    prop: 'num',
+    label: '总数量',
+    width: '70'
+  },
+  {
+    prop: 'addtime',
+    label: '下单时间',
+    sortable: true,
+    width: 150
+  },
+  {
+    prop: 'apply_name',
+    label: '申请人',
+    width: '80'
+  },
+  {
+    prop: '',
+    width: 50,
+    label: '操作',
+    fixed: 'right',
+    _noset_: true,
+    _slot_: 'operation'
+  }
+
+]
+// page	是	string	页码
+// size	是	string	页码数
+// cgdNo	是	string	采购单编号
+// returnCode	是	string	退货单编号
+// good_type_code	是	string	商品属性
+// good_name	是	string	商品名称
+// status	是	string	状态

+ 75 - 0
src/views/supplierSellOut/supplierReturnWorkOrder/components/ShowDataTableColumns.js

@@ -0,0 +1,75 @@
+
+const showColumns = [
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    span: 7
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    span: 5
+  },
+  {
+    prop: 'order_type',
+    label: '订单来源',
+    _slot_: 'order_type',
+    span: 6
+  }, {
+    prop: 'apply_name',
+    label: '创建人',
+    span: 6
+  },
+
+  {
+    prop: 'supplierName',
+    label: '供应商公司',
+    _slot_: 'supplierName',
+    span: 12
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司',
+    _slot_: 'companyName',
+    span: 12
+  },
+  {
+    prop: 'customer_code',
+    label: '客户公司',
+    _slot_: 'customer',
+    span: 12
+  },
+  {
+    prop: 'num',
+    label: '总数量',
+    span: 6
+  },
+  {
+    prop: 'addtime',
+    label: '创建时间',
+    span: 6
+  },
+  {
+    prop: 'sendtime',
+    label: '发货时间',
+    span: 6
+  },
+  {
+    prop: 'post_name',
+    label: '物流公司',
+    span: 6
+  },
+  {
+    prop: 'post_code',
+    label: '物流编号',
+    span: 6
+  },
+  {
+    prop: 'post_fee',
+    label: '物流费用',
+    span: 6
+  }
+]
+
+export { showColumns }

+ 184 - 0
src/views/supplierSellOut/supplierReturnWorkOrder/components/wait-stockman.vue

@@ -0,0 +1,184 @@
+<template>
+  <el-form
+    :model="ruleForm"
+    :rules="rules"
+    ref="ruleForm"
+    :size="'mini'"
+    label-width="90px"
+  >
+    <el-row>
+      <el-col :span="12"
+        ><el-form-item label="货物情况" prop="post_name">
+          <el-select placeholder="货物情况" style="width:100%" value="0">
+            <el-option v-for="opt in statusOptions" :key="opt.value" :value="opt.value" :label="opt.label" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="丢失数量" prop="post_fee">
+          <digital-input
+            :values="ruleForm.post_fee"
+            :placeholder="'丢失数量'"
+            :min="0"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            @reschange="number_change($event, 'post_fee')"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="备注" prop="post_code">
+          <el-input
+            placeholder="请输入备注"
+            type="textarea"
+            maxlength="100"
+            :size="'mini'"
+            v-model="ruleForm.post_code"
+            clearable
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            type="primary"
+            class="fr"
+            :size="'mini'"
+            @click="submitForm"
+            :loading="loading"
+            >保 存
+          </el-button>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/deliveryWorkOrder";
+import { isAlphanumeric } from "@/utils/validate";
+export default {
+  name: "allotFlow",
+  mixins: [resToken],
+  props: ["id", "sitem"],
+  computed: {
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find((i) => i.menu_route == "allotDetail") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "DBD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    const validateExpressSn = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("物流单号不能为空!"));
+      } else {
+        if (!isAlphanumeric(value)) {
+          callback(new Error("请输入正确的物流单号"));
+        } else {
+          callback();
+        }
+      }
+    };
+    const validate_post_fee = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
+      } else {
+        callback();
+      }
+    };
+
+    return {
+      status: "",
+      ruleForm: {
+        post_name: [], //发货物流公司
+        post_code: "", //物流单号
+        post_fee: "",
+      },
+      statusOptions:[
+        { value:'0', label:'库房未发货无需追回'},
+        { value:'1', label:'库房已发货无全部追回'},
+        { value:'2', label:'库房已发货已无法追回'},
+        { value:'3', label:'库房已发货已部分追回'},
+      ],
+      rules: {
+        post_name: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择发货公司",
+            trigger: "change",
+          },
+        ],
+        post_fee: [
+          {
+            required: true,
+            validator: validate_post_fee,
+            trigger: "blur",
+          },
+        ],
+        post_code: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validateExpressSn,
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    async number_change(e, key) {
+      this.ruleForm[key] = e + "" || "0";
+      this.$refs.ruleForm.validateField(key);
+    },
+    // 商品保存提交
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          if (this.loading) {
+            return;
+          }
+          this.loading = true;
+          const model = JSON.parse(JSON.stringify(this.ruleForm));
+          model.outChildCode = this.sitem.outChildCode;
+          model.post_name = model.post_name.toString();
+          
+          let res = await asyncRequest.express({list:[model]});
+          this.loading = false;
+          
+          if (res && res.code === 0) {
+            //
+            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;
+        }
+      });
+    },
+    handleCompany(e) {
+      console.log(e);
+      this.ruleForm.post_name = e && e.code ? [e.label] : [];
+      this.$refs.ruleForm.validateField("post_name");
+    },
+  },
+};
+</script>

+ 16 - 0
src/views/supplierSellOut/supplierReturnWorkOrder/components/work-order-mark.vue

@@ -0,0 +1,16 @@
+<template>
+  <div class="work-order-mark__wrapper">
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px">保存</el-button>
+  </div>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+export default {
+  components: { VueEditor },
+  data: () => ({
+    content: '退货工单详情'
+  })
+}
+</script>

+ 170 - 0
src/views/supplierSellOut/supplierReturnWorkOrder/detail.vue

@@ -0,0 +1,170 @@
+<template>
+  <div class="sellReturnDetail pagePadding">
+    <div style="width: 100%" v-if="powers.some((i) => i == '007')">
+      <el-tabs v-model="activeTabs">
+        <el-tab-pane label="业务详情" name="1">
+          <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
+            <el-collapse-item title="退货工单详情" name="0">
+              <show-data-table
+                style="margin: 0; padding: 0"
+                :sitem="sitem"
+                v-if="status"
+                :columns="showColumns"
+              >
+                <template slot="status">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (statusOptions.find((item) => item.value == sitem.status) || {}d)
+                        .label || '--'
+                    "
+                  ></el-tag>
+                </template>
+                
+
+                <template slot="order_type">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (
+                        xs_order_type_options.find(
+                          (item) => item.id == sitem.order_type
+                        ) || {}
+                      ).label || '--'
+                    "
+                  ></el-tag>
+                </template>
+
+                <template slot="supplierName">
+                  <span>{{ sitem.supplierName }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>供应商编号:</span><span>{{ sitem.supplierNo }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+                <template slot="companyName">
+                  <span>{{ sitem.companyName }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>业务公司编号:</span
+                        ><span>{{ sitem.companyNo }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+
+                <template slot="customer">
+                  <span>{{ sitem.customer_name }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>客户公司编号:</span
+                        ><span>{{ sitem.customer_code }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+              </show-data-table>
+            </el-collapse-item>
+
+            <el-collapse-item title="待库管收货" name="1">
+              <wait-stockman />
+            </el-collapse-item>
+
+            <el-collapse-item title="退货工单标记" name="2">
+              <work-order-mark />
+            </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+  </div>
+</template>
+<script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/returnGoodWorkOrder";
+import { showColumns } from "./components/ShowDataTableColumns";
+import { xs_order_type_options } from "@/assets/js/statusList";
+import WaitStockman from "./components/wait-stockman.vue";
+import WorkOrderMark from "./components/work-order-mark.vue"
+import { mapGetters } from "vuex";
+
+export default {
+  name: "deliveryWorkOrderDetail",
+  mixins: [mixinPage, resToken],
+  components: { WaitStockman, WorkOrderMark },
+  computed: {
+    ...mapGetters(['isSupertube']),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "supplierReturnWorkOrderDetail"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      activeTabs: "1",
+      showColumns: showColumns,
+      statusOptions: [
+        { value: "1", label: "待库管发货" },
+        { value: "2", label: "发货完成" },
+        { value: "3", label: "已收货" },
+        { value: '3', label: '供应商驳回,待供应商负责人审核'},
+        { value: '4', label: '已全部退货'},
+      ],
+      xs_order_type_options,
+      sitem: null, //传给组件
+      activeNames: ["0", "1", "2", "3", "4", "5", "6"],
+      status: "", //存储详情接口状态
+      statusList: [
+        { value: "1", label: "待验货" },
+        { value: "2", label: "待验货审核" },
+        { value: "3", label: "待业务审核" }
+      ],
+      newTime: "",
+      loading: false,
+      is_stock: "",
+      queryId: "",
+    };
+  },
+  mounted() {
+    this.queryId = this.$route.query.id;
+    this.initalData();
+  },
+  methods: {
+    async initData() {
+      const { code, data, message } = await asyncRequest.detail({
+        outChildCode: this.queryId,
+      });
+      if (code === 0) {
+        const { is_stock, status } = data;
+        this.is_stock = is_stock;
+        this.status = status;
+        this.sitem = data;
+        this.getNewTime();
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
+  },
+};
+</script>

+ 482 - 0
src/views/supplierSellOut/supplierReturnWorkOrder/index.vue

@@ -0,0 +1,482 @@
+<template>
+  <div class="sellReturn pagePadding">
+    <div
+      v-if=" powers.some((i) => i == '001')"
+    >
+      <ex-table
+        v-loading="loading"
+        :table="table"
+        :data="tableData"
+        :columns="columns"
+        :page="pageInfo"
+        :size="size"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @selection="handleSelection"
+        @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="margin-right:10px">
+                <el-input  placeholder="退货编号" size="mini" />
+              </el-col>
+
+              <el-col :span="4">
+                <el-select placeholder="退货单状态" size="mini" />
+              </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>
+          </div>
+        </template>
+        <template #status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '0' ? 'warning' : ''"
+            v-text="
+              (statusOptions.find((item) => item.value == scope.row.status) || {})
+                .label || '--'
+            "
+          ></el-tag>
+        </template>
+
+        <!-- <template #send_status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '0' ? 'warning' : ''"
+            v-text="
+              (sendStatusOptions.find((item) => item.value == scope.row.send_status) || {})
+                .label || '--'
+            "
+          ></el-tag>
+        </template> -->
+        
+        <template #order_type="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            v-text="
+              (
+                xs_order_type_options.find(
+                  (item) => item.id == scope.row.order_type
+                ) || {}
+              ).label || '--'
+            "
+          ></el-tag>
+        </template>
+
+        <template #order_source="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            v-text="
+              (
+              xs_order_source_options.find(
+                  (item) => item.id == scope.row.order_source
+                ) || {}
+              ).label || '--'
+            "
+          ></el-tag>
+        </template>
+
+        <template #operation="{ scope }">
+          <el-tooltip
+            v-if="powers.some((i) => i == '007')"
+            effect="dark"
+            content="详情"
+            placement="top"
+          >
+            <i
+              class="el-icon-view tb-icon"
+              @click="getRouter('supplierReturnWorkOrderDetail', scope.row.outChildCode)"
+            ></i>
+          </el-tooltip>
+        </template>
+      </ex-table>
+    </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/sellOut/returnGoodWorkOrder";
+import { mapGetters } from "vuex";
+import urlConfig from "@/apis/url-config";
+import { xs_order_type_options ,xs_order_source_options} from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper"
+
+export default {
+  name: "sellReturn",
+  mixins: [mixinPage, resToken, companyHelper],
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "supplierReturnWorkOrder"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      xs_order_type_options,
+      xs_order_source_options,
+      fileUrl: urlConfig.baseURL,
+      select: "outChildCode", //默认选择下拉框
+      s_input: "", //搜索框内容
+      select_list:[],
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { value: "0", label: "未拆单" },
+        { value: "1", label: "已拆单未发货" },
+        { value: "2", label: "部分发货" },
+        { value: '3', label: '全部发货' }
+      ],
+      loading: false,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        // companyNo:"",
+        customer_code:[],
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        company_name: "",
+        good_code:"",
+        skuCode:"",
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        order_type: "",
+      },
+      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() {
+    const { back } = this.$route.query;
+    if (back) {
+      this.parmValue = JSON.parse(back);
+      const { page, size } = this.parmValue;
+      // this.parmValue.start = start || last_start;
+      // this.parmValue.end = end || last_end;
+      // if(this.parmValue.companyNo.length>0){
+      //     this.customerCode = [this.parmValue.companyNo] ;
+      // }
+
+      this.pageInfo = {
+        size: size,
+        curr: page,
+        total: 0,
+      };
+      //多选条件
+      this.select = this.parmValue.select;
+      // this.sselect = this.parmValue.sselect;
+      this.s_input = this.parmValue.s_input;
+    } else {
+      this.select = "outChildCode";
+      //  this.sselect = "创建时间"
+    }
+    this.searchList();
+  },
+
+  methods: {
+    async supplierChange(e) {
+      const { code, label } = e;
+      this.supplierNo = code ? [code] : [];
+      this.searchList()
+    },
+    customer_code_change(e) {
+      if (e && e.code) {
+        this.parmValue.customer_code = [e.code];
+      } else {
+        this.parmValue.customer_code = [];
+      }
+      this.searchList();
+    },
+    handleExport(){
+      if (!this.loading) {
+        this.loading = true;
+        let httpType = `aplication/zip`;
+  
+        let model = JSON.parse(JSON.stringify(this.parmValue));
+        delete model['s_input']
+
+        axios({
+          method: "post",
+          url: this.fileUrl +  "/admin/child_export",
+          responseType: "blob",
+          data: {
+            ...model,
+            [this.select]: this.s_input,
+            customer_code: Array.isArray(this.parmValue.customer_code) ? this.parmValue.customer_code[0] : this.parmValue.customer_code,
+            supplierNo: Array.isArray(this.supplierNo) ? this.supplierNo[0] : this.supplierNo,
+            needRela: true
+          },
+          headers: {
+            Accept: httpType,
+          },
+        })
+          .then((res) => {
+            if (res && res.status == 200 && res.data) {
+              let url = window.URL.createObjectURL(
+                new Blob([res.data], { type: httpType })
+              );
+              let link = document.createElement("a");
+              link.style.display = "none";
+              link.href = url;
+              let excelName = "发货工单.zip";
+              link.setAttribute("download", excelName);
+              document.body.appendChild(link);
+              link.click();
+              link.remove();
+              window.URL.revokeObjectURL(url); //释放掉blob对象
+              this.$message.success(`导出成功!`);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            } else {
+              this.$message.error(res.data.message);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            }
+          })
+          .catch((error) => {
+            console.log(error);
+            this.loading = false;
+          });
+      }
+    },
+    handleSelection(order){
+      const { list } = order
+      this.select_list = list;
+    },
+    getRouter(toRouter, queryId) {
+      if (toRouter && queryId) {
+        let model = {
+          id: queryId,
+        };
+
+        //有多选框的条件
+        this.parmValue.select = this.select;
+        // this.parmValue.sselect = this.sselect ;
+        this.parmValue.s_input = this.s_input;
+        let routerModel = {
+          options: JSON.parse(JSON.stringify(this.parmValue)),
+          router: this.$route.path,
+        };
+        model.preModel = JSON.stringify(routerModel);
+
+        this.routeGoto(toRouter, model);
+      } 
+    },
+    restSearch() {
+      this.s_input = ""; //清除输入框内容
+      this.select = "outChildCode"; //清除下拉框选中项
+
+      this.parmValue = {
+        order_type: "",
+        company_name: "", //申请人部门
+        good_code:"",
+        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() {
+      if (
+        (this.parmValue.start !== "" && this.parmValue.end === "") ||
+        (this.parmValue.start === "" && this.parmValue.end !== "")
+      ) {
+        this.$message.warning("时间区间不完整!");
+        return;
+      }
+      this.loading = true;
+
+      let model = JSON.parse(JSON.stringify(this.parmValue));
+      delete model['s_input']
+
+      const res = await asyncRequest.list({
+        ...model,
+        [this.select]: this.s_input,
+        customer_code: Array.isArray(this.parmValue.customer_code) ? this.parmValue.customer_code[0] : this.parmValue.customer_code,
+        supplierNo: Array.isArray(this.supplierNo) ? this.supplierNo[0] : this.supplierNo,
+        companyNo: this.currentCompany,
+        noRelation: true
+      });
+
+      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 handleCompany(e) {
+      console.log(e, "要求传快递简称,不传id"); //
+      if (e && e.code) {
+        this.parmValue.postCompany = [e.shortName];
+        this.parmValue.page = 1;
+      }
+      await this.searchList();
+    },
+
+    company_idsearchChange(e) {
+      const { code } = e;
+      this.parmValue.companyNo = code || "";
+      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>
+.sellReturn {
+}
+</style>
+   

+ 0 - 0
src/views/supplierSellOut/supplierReturnWorkOrder/退货工单管理


+ 0 - 369
src/views/supplierSellOut/supplierSellAfterApply/components/express_feedback.vue

@@ -1,369 +0,0 @@
-<template>
-  <el-form
-    ref="ruleForm"
-    :loading="loading"
-    :model="ruleForm"
-    status-icon
-    :size="'mini'"
-    :rules="rules"
-    label-width="100px"
-    style="width: 100%"
-    class="demo-ruleForm"
-  >
-    <el-row>
-      <!-- <el-col :span="12" v-show="return_tag + '' === '2'">
-        <el-form-item label="仓库信息" prop="wsm_supplierNo">
-          <search-supplier
-            :size="'mini'"
-            :value="ruleForm.wsm_supplierNo"
-            :disabled="!(status + '' === '3' && ppowers.some((i) => i == '3'))"
-            :placeholder="'仓库所在公司'"
-            :names="wsm_supplier_name"
-            :isDetail="true"
-            @searchChange="supplierChange"
-          />
-        </el-form-item>
-      </el-col> -->
-      <!-- :companyCode="wsm_supplier_code" -->
-      <el-col :span="24" v-show="return_tag + '' === '2'">
-        <el-form-item prop="wsm_code" label-width="10px">
-          <search-stock
-            :size="'mini'"
-            :value="ruleForm.wsm_code"
-            :placeholder="'退库仓库'"
-            :disabled="!(status + '' === '3' && ppowers.some((i) => i + '' == '3'))"
-            :isDetail="true"
-            :isRelation="true"
-            :wsmtype="'4'"
-            :names="wsm_code_name"
-            :companyNo="sitem.customer_code"
-            @searchChange="stockChange"
-          />
-        </el-form-item>
-      </el-col>
-
-      <el-col
-        :span="24"
-        v-if="
-          (ruleForm.wsm_code &&
-            ruleForm.wsm_code.length === 1 &&
-            return_tag + '' === '2') ||
-          return_tag == '1'
-        "
-      >
-        <el-col :span="12">
-          <el-form-item label="收件人" prop="contactor">
-            <el-input
-              :disabled="
-                return_tag === '2' ||
-                !(status + '' === '3' && ppowers.some((i) => i == '3'))
-              "
-              v-model="ruleForm.contactor"
-              maxlength="20"
-              placeholder="收件人"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="收件人电话" prop="mobile">
-            <el-input
-              :disabled="
-                return_tag + '' === '2' ||
-                !(status + '' === '3' && ppowers.some((i) => i == '3'))
-              "
-              v-model="ruleForm.mobile"
-              maxlength="11"
-              placeholder="收件人电话"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="退回地址" prop="addr_code">
-            <select-area
-              :placeholder="'省/市/区'"
-              :value="ruleForm.addr_code"
-              :is-detail="true"
-              :size="'mini'"
-              @selectChange="addr_selectChange"
-              :disabled="
-                return_tag + '' === '2' ||
-                !(status + '' === '3' && ppowers.some((i) => i == '3'))
-              "
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label-width="10px" prop="addr">
-            <el-input
-              :disabled="
-                return_tag + '' === '2' ||
-                !(status + '' === '3' && ppowers.some((i) => i == '3'))
-              "
-              v-model="ruleForm.addr"
-              maxlength="250"
-              placeholder="退回地址"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-      </el-col>
-      <el-col
-        :span="24"
-        style="text-align: right; padding: 0 0 15px 0"
-        v-if="status + '' === '3' && ppowers.some((i) => i == '3')"
-      >
-        <el-button type="primary" @click="submitForm" size="mini">保 存</el-button>
-      </el-col>
-    </el-row>
-  </el-form>
-</template>
-<script>
-import asyncRequest from "@/apis/service/supplierSellOut/supplierSellAfterApply";
-import resToken from "@/mixins/resToken";
-import { isMobile, isChinese, isEmoticon } from "@/utils/validate";
-export default {
-  name: "sellAfterApplyDetail",
-  props: ["id", "newTime", "sitem"],
-  mixins: [resToken],
-  data() {
-    const validatename = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("收件人不能为空!"));
-      } else {
-        callback();
-      }
-    };
-    const validatemobile = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("手机号不能为空!"));
-      } else {
-        if (!isMobile(value)) {
-          callback(new Error("手机号格式不正确!"));
-        } else {
-          callback();
-        }
-      }
-    };
-    return {
-      loading: false,
-      status: "", //存储详情接口返的状态
-      showModelThis: this.showModel,
-      wsm_supplier_name: "",
-      wsm_code_name: "",
-      return_tag: "",
-      ruleForm: {
-        wsm_supplier: "",
-        wsm_supplierNo: [],
-        wsm_code: [],
-        wsm_codeNo: "",
-        contactor: "",
-        mobile: "",
-        addr_code: [],
-        addr: "",
-      },
-      rulesThis: this.rules,
-      // 验证规则
-      rules: {
-        wsm_supplierNo: [
-          {
-            type: "array",
-            required: true,
-            trigger: "change",
-            message: "请选择仓库所在公司",
-          },
-        ],
-        wsm_code: [
-          {
-            type: "array",
-            required: true,
-            trigger: "change",
-            message: "请选择退货仓库",
-          },
-        ],
-        contactor: [
-          {
-            required: true,
-            trigger: "blur",
-            validator: validatename,
-          },
-        ],
-        mobile: [
-          {
-            required: true,
-            trigger: "blur",
-            validator: validatemobile,
-          },
-        ],
-        addr_code: [
-          {
-            type: "array",
-            required: true,
-            trigger: "change",
-            message: "请选择省市区",
-          },
-        ],
-        addr: [
-          {
-            required: true,
-            trigger: "blur",
-            message: "请输入详细地址",
-          },
-        ],
-      },
-    };
-  },
-  computed: {
-    powers() {
-      const tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "supplierSellAfterApplyDetail"
-        ) || {};
-      const { action } = tran ?? {};
-      return action ?? [];
-    },
-    ppowers() {
-      const tran =
-        this.$store.getters.roleProcess.find((i) => i.process_type === "SHD") || {};
-      const { action } = tran ?? {};
-      return action ?? [];
-    },
-  },
-  watch: {
-    newTime: function (val) {
-      if (val) {
-        this.initForm();
-      }
-    },
-  },
-  mounted() {
-    this.initForm();
-  },
-  methods: {
-    async initForm() {
-      this.loading = true;
-      this.status = "";
-      this.rulesThis = this.rules;
-      await this.resetForm();
-      this.loading = false;
-    },
-
-    async resetForm() {
-      // 重置
-      await this.$nextTick(() => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          const {
-            status,
-            returnCode,
-            return_wsm,
-            addr,
-            mobile,
-            contactor,
-            wsm_supplierNo,
-            wsm_supplier,
-            wsm_name,
-            addr_code,
-            addrs_code,
-            return_tag,
-          } = this.sitem;
-
-          this.status = status;
-          this.return_tag = return_tag || "";
-          this.wsm_supplier_name = wsm_supplier;
-          this.wsm_code_name = wsm_name;
-          this.wsm_supplier_code = wsm_supplierNo;
-
-          this.ruleForm = {
-            returnCode: returnCode || "",
-            wsm_code: return_wsm ? [return_wsm] : [],
-            wsm_supplierNo: wsm_supplierNo ? [wsm_supplierNo] : [],
-            contactor: contactor || "",
-            mobile: mobile || "",
-            addr: addr || "",
-            addr_code: [],
-          };
-          if (addr_code) {
-            let code_arr = addr_code.split(",");
-            this.ruleForm.addr_code = code_arr && code_arr.length === 3 ? code_arr : [];
-          }
-          this.rulesThis.wsm_supplierNo[0].required = this.return_tag + "" === "2";
-          this.rulesThis.wsm_code[0].required = this.return_tag + "" === "2";
-        }
-      });
-    },
-    async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          if (this.loading) {
-            return;
-          }
-          this.loading = true;
-          let model = JSON.parse(JSON.stringify(this.ruleForm));
-          model.addr_code = model.addr_code.toString();
-          model.wsm_code = model.wsm_code.toString();
-          delete model["wsm_codeNo"];
-          delete model["wsm_supplier"];
-          delete model["wsm_supplierNo"];
-          console.log(model);
-          // let model = {
-          //   returnCode: this.ruleForm.returnCode,
-          //   wsm_code: this.ruleForm.wsm_codeNo,
-          //   addr_code: "",
-          //   addr: "",
-          //   mobile: "",
-          //   contactor: "",
-          // };
-          const res = await asyncRequest.aftersetwsm(model);
-          this.loading = false;
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "提交成功",
-              message: "",
-            });
-            this.$emit("refresh", false);
-          } 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;
-        }
-      });
-    },
-
-    async supplierChange(e) {
-      if (e && e.id) {
-        this.wsm_supplier_code = e.code;
-        this.ruleForm.wsm_supplierNo = [e.code];
-      } else {
-        this.ruleForm.wsm_supplier = [];
-        this.wsm_supplier_code = "";
-      }
-      this.ruleForm.wsm_code = "";
-      this.wsm_code = [];
-      this.ruleForm.contactor = "";
-      this.ruleForm.mobile = "";
-      this.ruleForm.addr = "";
-    },
-    async stockChange(e) {
-      const { code, contactor, mobile, addr, addr_code, addr_cn } = e;
-      console.log(e);
-      this.ruleForm.wsm_codeNo = code || "";
-      this.ruleForm.wsm_code = code ? [code] : [];
-      this.ruleForm.contactor = contactor || "";
-      this.ruleForm.mobile = mobile || "";
-      this.ruleForm.addr = addr || "";
-      const { provice_code, city_code, area_code } = addr_code;
-      this.ruleForm.addr_code = code ? [provice_code, city_code, area_code] : [];
-    },
-    addr_selectChange(e) {
-      this.ruleForm.addr_code = e || [];
-      this.$refs.ruleForm.validateField("addr_code");
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 86 - 0
src/views/supplierSellOut/supplierSellAfterApply/components/set-work-order.vue

@@ -0,0 +1,86 @@
+<template>
+  <div class="work-order__wrapper">
+    <el-table size="mini" border :data="list">
+      <el-table-column label="销售订单" />
+      <el-table-column label="发货申请单" width="110px" />
+      <el-table-column label="提退时发货申请单状态" width="150px" />
+      <el-table-column label="发货工单" />
+      <el-table-column label="发货仓库所在供应商名称" width="160px" />
+      <el-table-column label="发货仓库所在供应商编码" width="160px" />
+      <el-table-column label="发货仓库名称" width="100px" />
+      <el-table-column label="发货仓库编码" width="100px" />
+      <el-table-column label="发货仓库负责人" width="110px" />
+      <el-table-column label="发货数量" width="110px" />
+      <el-table-column width="110px">
+        <template slot="header">
+          <span style="color:red;margin-right:2px">*</span>退货数量
+        </template>
+        <template slot-scope="scope">
+          <digital-input
+            :values="list[scope.$index].num"
+            :placeholder="'退货数量'"
+            :min="0"
+            :disabled="false"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            @reschange="onNumberChange($event, scope.$index)"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column label="退货仓库所在供应商名称" width="160px" />
+      <el-table-column label="退货仓库所在供应商编码" width="160px" />
+      <el-table-column width="160px">
+        <template slot="header">
+          <span style="color:red;margin-right:2px">*</span>退货仓库编码
+        </template>
+        <template slot-scope="scope">
+          <search-stock
+            :is-detail="false"
+            :size="'mini'"
+            :value="list[scope.$index].wsmCode"
+            :placeholder="'仓库名称'"
+            :is-relation="true"
+            :wsmtype="'5'"
+            :company-no="currentCompany"
+            :disbaled="!currentCompany"
+            :names="''"
+            @searchChange="onStockChange($event, scope.$index)"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="退货仓库负责人" width="110px" />
+    </el-table>
+    <el-button class="fr" style="margin:10px 0px" size="mini" type="primary">保存</el-button>
+  </div>
+</template>
+
+<script>
+import companyHelper from '@/mixins/companyHelper'
+import resToken from '@/mixins/resToken'
+export default {
+  name: 'WorkOrder',
+  mixins: [resToken, companyHelper],
+  props: ['sitem'],
+  data: () => ({
+    list: [{ wsmCode: '', num: 0 }]
+  }),
+  methods: {
+    onStockChange({ code } = {}, index) {
+      this.$set(this.list, index, {
+        ...this.list[index],
+        wsmCode: code ? [code] : ''
+      })
+    },
+    onNumberChange(num, index) {
+      this.$set(this.list, index, {
+        num
+      })
+    }
+  }
+}
+</script>

+ 108 - 0
src/views/supplierSellOut/supplierSellAfterApply/components/wait-stockman.vue

@@ -0,0 +1,108 @@
+<template>
+  <div class="work-order__wrapper">
+    <el-table size="mini" border :data="list">
+      <el-table-column label="确认单编号" width="110px" />
+      <el-table-column label="发货单" width="110px" />
+      <el-table-column label="发货单状态" width="150px" />
+      <el-table-column label="发货工单" />
+      <el-table-column label="发货仓库所在供应商名称" width="160px" />
+      <el-table-column label="发货仓库所在供应商编码" width="160px" />
+      <el-table-column label="发货仓库名称" width="100px" />
+      <el-table-column label="发货仓库编码" width="100px" />
+      <el-table-column label="发货仓库负责人" width="110px" />
+      <el-table-column label="发货物流" width="110px" />
+      <el-table-column label="发货物流单号" width="110px" />
+      <el-table-column label="发货数量" width="110px" />
+      <el-table-column label="退货仓库所在供应商名称" width="160px" />
+      <el-table-column label="退货仓库所在供应商编码" width="160px" />
+      <el-table-column label="退货数量" width="110px" />
+      <el-table-column label="退货销售仓库名称" width="160px" />
+      <el-table-column label="退货销售仓库编码" width="120px" />
+      <el-table-column label="退货销售仓库负责人" width="130px" />
+      <el-table-column width="130px">
+        <template slot="header">
+          <span style="color:red;margin-right:2px">*</span>销售仓入库数量
+        </template>
+        <template slot-scope="scope">
+          <digital-input
+            :values="list[scope.$index].num"
+            :placeholder="'销售仓入库数量'"
+            :min="0"
+            :disabled="false"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            @reschange="onNumberChange($event, scope.$index,'销售仓入库数量')"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column width="130px">
+        <template slot="header">
+          <span style="color:red;margin-right:2px">*</span>次品仓入库数量
+        </template>
+        <template slot-scope="scope">
+          <digital-input
+            :values="list[scope.$index].num"
+            :placeholder="'销售仓入库数量'"
+            :min="0"
+            :disabled="false"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            @reschange="onNumberChange($event, scope.$index,'次品仓入库数量')"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column width="130px">
+        <template slot="header">
+          <span style="color:red;margin-right:2px">*</span>丢失数量
+        </template>
+        <template slot-scope="scope">
+          <digital-input
+            :values="list[scope.$index].num"
+            :placeholder="'丢失数量'"
+            :min="0"
+            :disabled="false"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            @reschange="onNumberChange($event, scope.$index,'丢失数量')"
+          />
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-button class="fr" style="margin:10px 0px" size="mini" type="primary">保存</el-button>
+  </div>
+</template>
+
+<script>
+import resToken from '@/mixins/resToken'
+export default {
+  name: 'WorkOrder',
+  mixins: [resToken],
+  props: ['sitem'],
+  data: () => ({
+    list: [
+      { wsmCode: '', num: 0 }
+    ]
+  }),
+  methods: {
+    onNumberChange(num, index, prop) {
+      this.$set(this.list, index, {
+        ...this.list[index],
+        [prop]: num
+      })
+    }
+  }
+}
+</script>

+ 13 - 3
src/views/supplierSellOut/supplierSellAfterApply/detail.vue

@@ -125,6 +125,14 @@
                 @refresh="initData"
               ></express-feedback>
             </el-collapse-item> -->
+
+            <el-collapse-item name="8" title="待设置工单">
+              <set-work-order :sitem="sitem" />
+            </el-collapse-item>
+
+            <el-collapse-item name="9" title="待库管收货">
+              <wait-stockman :sitem="sitem" />
+            </el-collapse-item>
           </el-collapse>
         </el-tab-pane>
 
@@ -152,13 +160,14 @@
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/supplierSellOut/supplierSellAfterApply";
-import ExpressFeedback from "./components/express_feedback";
 import { sellshowColumns } from "./columns";
 import purchaseExam from "./components/purchase_exam";
 import SupplierExam from "./components/supplier_exam.vue";
 import { xs_order_type_options } from "@/assets/js/statusList";
 import WaitReturn from "./components/wait-return.vue";
 import SupplierConfrim from "./components/supplier-confirm.vue";
+import SetWorkOrder from "./components/set-work-order.vue"
+import WaitStockman from "./components/wait-stockman.vue";
 import { mapGetters } from "vuex";
 
 export default {
@@ -168,8 +177,9 @@ export default {
     WaitReturn,
     SupplierExam,
     purchaseExam,
-    ExpressFeedback,
-    SupplierConfrim
+    SupplierConfrim,
+    SetWorkOrder,
+    WaitStockman
   },
   computed: {
     ...mapGetters(['isSuppertube']),

+ 141 - 0
src/views/supplierSellOut/supplierSellReturn/components/set-work-order.vue

@@ -0,0 +1,141 @@
+<template>
+  <div class="work-order__wrapper">
+    <template v-if="isSalesWarehouselist">
+      <el-table size="mini" border :data="list">
+        <el-table-column label="销售订单" />
+        <el-table-column label="发货申请单" width="110px" />
+        <el-table-column label="提退时发货申请单状态" width="150px" />
+        <el-table-column label="发货工单" />
+        <el-table-column label="发货仓库所在供应商名称" width="160px" />
+        <el-table-column label="发货仓库所在供应商编码" width="160px" />
+        <el-table-column label="发货仓库名称" width="100px" />
+        <el-table-column label="发货仓库编码" width="100px" />
+        <el-table-column label="发货仓库负责人" width="110px" />
+        <el-table-column label="发货数量" />
+        <el-table-column width="110px">
+          <template slot="header">
+            <span style="color:red;margin-right:2px">*</span>退货数量
+          </template>
+          <template slot-scope="scope">
+            <digital-input
+              :values="list[scope.$index].num"
+              :placeholder="'退货数量'"
+              :min="0"
+              :disabled="false"
+              :max="100000000000"
+              :position="'right'"
+              :precision="0"
+              :size="'mini'"
+              :controls="false"
+              :append="''"
+              @reschange="onNumberChange($event, scope.$index)"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column label="退货仓库所在供应商名称" width="160px" />
+        <el-table-column label="退货仓库所在供应商编码" width="160px" />
+        <el-table-column width="160px">
+          <template slot="header">
+            <span style="color:red;margin-right:2px">*</span>退货仓库编码
+          </template>
+          <template slot-scope="scope">
+            <search-stock
+              :is-detail="false"
+              :size="'mini'"
+              :value="list[scope.$index].wsmCode"
+              :placeholder="'仓库名称'"
+              :is-relation="true"
+              :wsmtype="'5'"
+              :company-no="currentCompany"
+              :disbaled="!currentCompany"
+              :names="''"
+              @searchChange="onStockChange($event, scope.$index)"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column label="退货仓库负责人" width="110px" />
+      </el-table>
+    </template>
+
+    <template v-else>
+      <el-form :model="formData" :rules="rules">
+        <el-form-item prop="wsmCode" label="销售仓" style="display:flex">
+          <search-stock
+            style="width:300px"
+            :is-detail="false"
+            :size="'mini'"
+            :value="wsmCode"
+            :placeholder="'销售仓'"
+            :is-relation="true"
+            :wsmtype="'5'"
+            :company-no="currentCompany"
+            :disbaled="!currentCompany"
+            :names="''"
+            @searchChange="onStockChange($event, scope.$index, true)"
+          />
+        </el-form-item>
+      </el-form>
+    </template>
+
+    <el-button class="fr" style="margin:10px 0px" size="mini" type="primary">保存</el-button>
+  </div>
+</template>
+
+<script>
+import companyHelper from '@/mixins/companyHelper'
+import resToken from '@/mixins/resToken'
+export default {
+  name: 'WorkOrder',
+  mixins: [resToken, companyHelper],
+  props: ['sitem'],
+  data: () => ({
+    rules: {
+      wsmCode: [{ required: true, type: 'array', message: '请选择销售仓', trigger: 'change' }]
+    },
+    formData: {
+      wsmCode: ''
+    },
+    list: [
+      { wsmCode: '', num: 0 }
+    ]
+  }),
+  computed: {
+    state() {
+      const { order_type, send_type } = this.sitem || {}
+      return ({
+        isHasWorkOrder: true, // true:有发货工单 false:无发货工单
+        isStock: String(order_type) === '1', // true:库存品 false:非库存品/采返商品/报备商品
+        isHasAddr: String(send_type) === '1' // true:有地址 false:无地址
+      })
+    },
+    isSalesWarehouselist() {
+      const { isHasAddr, isHasWorkOrder, isStock } = this.state
+      // 有地址 && 有发货工单 && 库存品
+      if (isHasAddr && isHasWorkOrder & isStock) return true
+      // 有地址 && 不是库存品
+      if (isHasAddr && !isStock) return true
+      return false
+    }
+  },
+  methods: {
+    onStockChange(e, index, isForm) {
+      const { code } = e
+      if (isForm) {
+        this.formData.wsmCode = code ? [code] : ''
+        return
+      }
+
+      this.$set(this.list, index, {
+        ...this.list[index],
+        wsmCode: code ? [code] : ''
+      })
+    },
+    onNumberChange(num, index) {
+      this.$set(this.list, index, {
+        ...this.list[index],
+        num
+      })
+    }
+  }
+}
+</script>

+ 10 - 98
src/views/supplierSellOut/supplierSellReturn/detail.vue

@@ -145,40 +145,7 @@
                 :iscgd="false"
               />
             </el-collapse-item>
-            <!-- newTime !== '' &&
-                sitem &&
-                !(
-                  (sitem.order_type + '' === '1' || sitem.order_type + '' === '2') &&
-                  is_stock + '' === '1'
-                ) &&
-                ppowers.some((i) => i == '1') && -->
-            <!-- <el-collapse-item
-              title="业务审核"
-              name="3"
-              v-if="hasPermission({status:'1', process:'1'})"
-            >
-              <exam-form
-                v-if="newTime"
-                :statusList="statusList"
-                :newTime="newTime"
-                :disabled="false"
-                :isMust="false"
-                @searchChange="examForm"
-              />
-            </el-collapse-item> -->
-
-            <!-- newTime !== '' &&
-                sitem &&
-                !(
-                  (sitem.order_type + '' === '1' || sitem.order_type + '' === '2') &&
-                  is_stock + '' === '1'
-                ) &&
-                ppowers.some((i) => i == '1') && -->
-            <el-collapse-item
-              title="供应商审核"
-              name="4"
-              v-if="hasPermission({status:'9', process:'9'})"
-            >
+            <el-collapse-item title="供应商审核" name="4" v-if="isHasPermission({status:'9', process:'9'})">
               <exam-form
                 v-if="newTime"
                 :statusList="statusList"
@@ -189,7 +156,7 @@
               />
             </el-collapse-item>
 
-            <el-collapse-item title="业务公司修改,待供应商确认" name="6" v-if="hasPermission({status:'10', process:'10'})">
+            <el-collapse-item title="业务公司修改,待供应商确认" name="6" v-if="isHasPermission({status:'10', process:'10'})">
               <exam-form
                 v-if="newTime"
                 :statusList="statusList"
@@ -200,57 +167,12 @@
               />
             </el-collapse-item>
 
-            <!-- <el-collapse-item
-              title="采购专员审批"
-              name="4"
-              v-if="
-                sitem &&
-                (status + '' === '4' || status + '' === '3' || status + '' === '2') &&
-                !(
-                  ((sitem && sitem.order_type + '' === '1') || sitem.order_type + '' === '2') &&
-                  is_stock + '' === '1'
-                )
-              "
-            >
-              <com-exam-form
-                v-if="newTime"
-                :statusList="statusList"
-                :newTime="newTime"
-                :sitem="sitem"
-                :disabled="
-                  status + '' === '4' ||
-                  status + '' === '3' ||
-                  !(ppowers.some((i) => i == '2') && status + '' === '2')
-                "
-                :isMust="false"
-                @refresh="initData"
-              />
-            </el-collapse-item> -->
-<!-- 
-            <el-collapse-item
-              title="采购主管审批"
-              name="5"
-              v-if="
-                sitem &&
-                ppowers.some((i) => i == '3') &&
-                status + '' === '3' &&
-                !(
-                  (sitem.order_type + '' === '1' || sitem.order_type + '' === '2') &&
-                  is_stock + '' === '1'
-                )
-              "
-            >
-              <exam-form
-                v-if="newTime"
-                :statusList="statusList"
-                :newTime="newTime"
-                :disabled="false"
-                :isMust="false"
-                @searchChange="dirExamForm"
-              />
-            </el-collapse-item> -->
+            <el-collapse-item title="待设置工单" name="7">
+              <set-work-order :sitem="sitem" />
+            </el-collapse-item>
           </el-collapse>
         </el-tab-pane>
+
         <el-tab-pane label="审批记录" name="2">
           <process-time-line
             v-if="newTime !== ''"
@@ -279,14 +201,15 @@ import comExamForm from "./components/comExamForm";
 import ApprovalResults from "./components/approval-results.vue";
 import { showColumns } from "./components/ShowDataTableColumns";
 import { xs_order_type_options } from "@/assets/js/statusList";
+import SetWorkOrder from "@/views/sellOut/sellAfterApply/components/set-work-order.vue";
 import { mapGetters } from "vuex";
 export default {
   name: "sellReturnDetail",
   mixins: [mixinPage, resToken],
   components: {
     comExamForm,
+    SetWorkOrder,
     ApprovalResults
-    // ReturnCheck,
   },
   computed: {
     ...mapGetters(['isSupertube']),
@@ -310,27 +233,16 @@ export default {
       activeTabs: "1",
       showColumns: showColumns,
       statusOptions: [
-           // { value: "1", label: "待业务审批" },
-        // { value: "2", label: "待专员审批" },
-        // { value: "3", label: "待主管审批" },
-        // { value: "4", label: "退货完成" },
-        // { value: "5", label: "业务驳回" },
-        // { value: "6", label: "采购驳回" },
-        // { value: "7", label: "专员审批不通过" },
         { value: "1", label: "待业务审批" },
-        // { value: "2", label: "待专员审批" },
-        // { value: "3", label: "待主管审批" },
         { value: "4", label: "退货完成" },
         { value: "5", label: "业务驳回" },
-        // { value: "6", label: "采购驳回" }, // 废弃
-        // { value: "7", label: "专员审批不通过" },
         { value: '8', label:'供应商驳回,待供应商负责人审核'},
         { value: '9', label:'待供应商审核'},
         { value: '10', label:'业务公司修改,待供应商确认'}
       ],
       xs_order_type_options,
       sitem: null, //传给组件
-      activeNames: ["0", "1", "2", "3", "4", "5", "6"],
+      activeNames: ["0", "1", "2", "3", "4", "5", "6", "7"],
       sitem: null,
       status: "", //存储详情接口状态
       statusList: [
@@ -446,7 +358,7 @@ export default {
       }
     },
 
-    hasPermission({status, process}){
+    isHasPermission({status, process}){
       return !this.isSupertube && String(this.sitem.status) === status && this.ppowers.includes(process)
     },
     async initData() {

+ 1 - 2
src/views/youzan/othOrder/detail.vue

@@ -350,6 +350,5 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
-.othOrderDetail {
-}
+.othOrderDetail {}
 </style>