snow 1 year ago
parent
commit
fceb08e76f
46 changed files with 9203 additions and 0 deletions
  1. 126 0
      src/views/purchaseIn/beforeReturnGoodWorkOrder/columns.js
  2. 85 0
      src/views/purchaseIn/beforeReturnGoodWorkOrder/components/ShowDataTableColumns.js
  3. 60 0
      src/views/purchaseIn/beforeReturnGoodWorkOrder/components/mark-modal.vue
  4. 183 0
      src/views/purchaseIn/beforeReturnGoodWorkOrder/components/wait-stockman.vue
  5. 37 0
      src/views/purchaseIn/beforeReturnGoodWorkOrder/components/work-order-mark.vue
  6. 212 0
      src/views/purchaseIn/beforeReturnGoodWorkOrder/detail.vue
  7. 599 0
      src/views/purchaseIn/beforeReturnGoodWorkOrder/index.vue
  8. 0 0
      src/views/purchaseIn/beforeReturnGoodWorkOrder/售前退货工单管理
  9. 287 0
      src/views/purchaseIn/deliveryWorkOrder/columns.js
  10. 86 0
      src/views/purchaseIn/deliveryWorkOrder/components/ShowDataTableColumns.js
  11. 281 0
      src/views/purchaseIn/deliveryWorkOrder/components/express.vue
  12. 229 0
      src/views/purchaseIn/deliveryWorkOrder/detail.vue
  13. 699 0
      src/views/purchaseIn/deliveryWorkOrder/index.vue
  14. 308 0
      src/views/purchaseIn/deliveryWorkOrder/sendOutOrder.vue
  15. 0 0
      src/views/purchaseIn/deliveryWorkOrder/发货工单管理
  16. 124 0
      src/views/purchaseIn/returnGoodWorkOrder/columns.js
  17. 102 0
      src/views/purchaseIn/returnGoodWorkOrder/components/ShowDataTableColumns.js
  18. 58 0
      src/views/purchaseIn/returnGoodWorkOrder/components/mark-modal.vue
  19. 185 0
      src/views/purchaseIn/returnGoodWorkOrder/components/wait-stockman.vue
  20. 36 0
      src/views/purchaseIn/returnGoodWorkOrder/components/work-order-mark.vue
  21. 239 0
      src/views/purchaseIn/returnGoodWorkOrder/detail.vue
  22. 668 0
      src/views/purchaseIn/returnGoodWorkOrder/index.vue
  23. 0 0
      src/views/purchaseIn/returnGoodWorkOrder/售后退货工单管理
  24. 132 0
      src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/columns.js
  25. 85 0
      src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/components/ShowDataTableColumns.js
  26. 60 0
      src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/components/mark-modal.vue
  27. 176 0
      src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/components/wait-stockman.vue
  28. 37 0
      src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/components/work-order-mark.vue
  29. 214 0
      src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/detail.vue
  30. 623 0
      src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/index.vue
  31. 0 0
      src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/退货工单管理
  32. 287 0
      src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/columns.js
  33. 81 0
      src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/components/ShowDataTableColumns.js
  34. 281 0
      src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/components/express.vue
  35. 230 0
      src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/detail.vue
  36. 690 0
      src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/index.vue
  37. 308 0
      src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/sendOutOrder.vue
  38. 0 0
      src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/发货工单管理
  39. 128 0
      src/views/supplierPurchaseIn/supplierReturnWorkOrder/columns.js
  40. 96 0
      src/views/supplierPurchaseIn/supplierReturnWorkOrder/components/ShowDataTableColumns.js
  41. 58 0
      src/views/supplierPurchaseIn/supplierReturnWorkOrder/components/mark-modal.vue
  42. 185 0
      src/views/supplierPurchaseIn/supplierReturnWorkOrder/components/wait-stockman.vue
  43. 36 0
      src/views/supplierPurchaseIn/supplierReturnWorkOrder/components/work-order-mark.vue
  44. 236 0
      src/views/supplierPurchaseIn/supplierReturnWorkOrder/detail.vue
  45. 656 0
      src/views/supplierPurchaseIn/supplierReturnWorkOrder/index.vue
  46. 0 0
      src/views/supplierPurchaseIn/supplierReturnWorkOrder/退货工单管理

+ 126 - 0
src/views/purchaseIn/beforeReturnGoodWorkOrder/columns.js

@@ -0,0 +1,126 @@
+export default [
+  // { type: 'selection', fixed: 'left', _noset_: true },
+  {
+    prop: 'saleReturnChildCode',
+    label: '售前退货工单编号',
+    width: '160'
+  },
+  {
+    prop: 'returnCode',
+    label: '售前退货单编号',
+    width: '160'
+  },
+  {
+    prop: 'orderCode',
+    label: '订单编号',
+    width: '160px'
+  },
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    width: '160px'
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    width: '80px'
+  },
+  {
+    prop: 'use_type',
+    label: '平台类型',
+    _slot_: 'use_type',
+    width: '80px'
+  },
+ 
+  {
+    prop: 'order_source',
+    label: '订单来源',
+    _slot_: 'order_source',
+    width: '100px'
+  },
+  {
+    prop: 'order_type',
+    label: '商品类型',
+    _slot_: 'order_type',
+    width: '100px'
+  },
+  {
+    prop: 'good_code',
+    label: '商品编码',
+    width: '160px'
+  },
+  {
+    prop: 'good_name',
+    label: '商品名称',
+    width: '160px'
+  },
+
+  {
+    prop: 'return_wsm_name',
+    label: '退回仓库名称',
+    width: '150px',
+    _slot_: 'returnWsm'
+  },
+  {
+    prop: 'return_contactor_name',
+    label: '退回仓库负责人',
+    width: '120px'
+  },
+  {
+    prop: 'companyNo',
+    label: '业务公司编号',
+    width: '150px'
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司名称',
+    width: '150px'
+  },
+  {
+    prop: 'supplierNo',
+    label: '供应商编码',
+    width: '150px'
+  },
+  {
+    prop: 'supplierName',
+    label: '供应商名称',
+    width: '150px'
+  },
+  {
+    prop: 'customer_code',
+    label: '客户编码',
+    width: '150px'
+  },
+  {
+    prop: 'customerName',
+    label: '客户名称',
+    width: '150px'
+  },
+  {
+    prop: 'apply_name',
+    label: '申请人',
+    span: 5
+  },
+  {
+    prop: 'addtime',
+    label: '创建时间',
+    width: '150px'
+  },
+  {
+    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	状态

+ 85 - 0
src/views/purchaseIn/beforeReturnGoodWorkOrder/components/ShowDataTableColumns.js

@@ -0,0 +1,85 @@
+const showColumns = [
+  {
+    prop: 'returnCode',
+    label: '售前退货工单号',
+    span: 8
+  },
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    span: 8
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    span: 4
+  },
+  {
+    prop: 'apply_name',
+    label: '创建人',
+    span: 4
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司',
+    _slot_: 'companyName',
+    span: 12
+  },
+  {
+    prop: 'customerName',
+    label: '客户公司',
+    _slot_: 'customerName',
+    span: 12
+  },
+  {
+    prop: 'supplierName',
+    label: '供应商',
+    _slot_: 'supplierName',
+    span: 12
+  },
+  {
+    prop: 'return_wsm_code',
+    label: '退货仓库',
+    _slot_: 'returnWsm',
+    span: 12
+  },
+  // {
+  //   prop: 'send_wsm_code',
+  //   label: '发货仓库编码',
+  //   span: 12
+  // },
+  {
+    prop: 'send_num',
+    label: '发货数量',
+    span: 5
+  },
+  {
+    prop: 'return_num',
+    label: '退货数量',
+    span: 5
+  },
+  {
+    prop: 'loss_num',
+    label: '丢失数量',
+    span: 5
+  },
+  {
+    prop: 'addtime',
+    label: '创建时间',
+    span: 9
+  },
+  {
+    prop: 'remark',
+    label: '备注',
+    span: 24
+  },
+  {
+    prop: 'record',
+    label: '标记',
+    span: 24,
+    _slot_: 'record'
+  }
+]
+
+export { showColumns }

+ 60 - 0
src/views/purchaseIn/beforeReturnGoodWorkOrder/components/mark-modal.vue

@@ -0,0 +1,60 @@
+<template>
+  <el-dialog :visible.sync="innerVisible" title="退货工单标记" center>
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px" :loading="loading" @click="() => onMark()">保存</el-button>
+    <div style="clear:both" />
+  </el-dialog>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+import asyncRequest from '@/apis/service/sellOut/beforeReturnGoodWorkOrder'
+export default {
+  components: { VueEditor },
+  props: ['sitem', 'visible'],
+  data: () => ({
+    content: '',
+    loading: false
+  }),
+  computed: {
+    innerVisible: {
+      get() {
+        return this.visible
+      },
+      set(newValue) {
+        this.$emit('update:visible', newValue)
+      }
+    }
+  },
+  watch: {
+    visible: {
+      handler() {
+        if (!this.visible) return null
+        this.$nextTick(() => {
+          console.log(this.sitem.record)
+          this.content = this.sitem.record
+        })
+      },
+      immediate: true
+    }
+  },
+  methods: {
+    async onMark() {
+      this.loading = true
+      const { code, message } = await asyncRequest.setAfterChildRecord({ record: this.content, id: this.sitem.id })
+      this.loading = false
+
+      switch (code) {
+        case 0:
+          this.content = ''
+          this.innerVisible = false
+          this.$emit('reload')
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 183 - 0
src/views/purchaseIn/beforeReturnGoodWorkOrder/components/wait-stockman.vue

@@ -0,0 +1,183 @@
+<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="good_receive_type">
+          <el-select placeholder="货物情况" style="width:100%" v-model="ruleForm.good_receive_type">
+            <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="loss_num">
+          <digital-input
+            :values="ruleForm.loss_num"
+            :placeholder="'丢失数量'"
+            :min="0"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            :disabled="disabledLossField"
+            @reschange="number_change($event, 'loss_num')"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            placeholder="请输入备注"
+            type="textarea"
+            maxlength="100"
+            :size="'mini'"
+            v-model="ruleForm.remark"
+            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/beforeReturnGoodWorkOrder";
+export default {
+  name: "allotFlow",
+  mixins: [resToken],
+  props: ["id", "sitem"],
+  computed: {
+    disabledLossField(){
+      const {good_receive_type} = this.ruleForm;
+      return ['1','2','3'].includes(good_receive_type)
+    },
+    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() {
+    return {
+      status: "",
+      ruleForm: {
+        good_receive_type: "1", //发货物流公司
+        remark: "", //物流单号
+        loss_num: "",
+      },
+      statusOptions:[
+        { value:'1', label:'库房未发货无需追回'},
+        { value:'2', label:'库房已发货已全部追回'},
+        { value:'3', label:'库房已发货已无法追回'},
+        { value:'4', label:'库房已发货已部分追回'},
+      ],
+      rules: {
+        good_receive_type: [
+          {
+            required: true,
+            message: "请选择货物情况",
+            trigger: "blur",
+          },
+        ],
+        loss_num: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请输入丢失数量",
+          },
+        ],
+        remark: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请输入备注"
+          },
+        ],
+      },
+    };
+  },
+  watch:{
+    'ruleForm.good_receive_type':{
+      handler(value){
+        if(value === '3'){
+        this.ruleForm.loss_num = this.sitem.return_num;
+      }else{
+        this.ruleForm.loss_num = "0"
+        }
+       },
+       immediate:true
+      }
+  },
+  methods: {
+    async number_change(e, key) {
+      this.ruleForm[key] = e + "" || "0";
+      this.$refs.ruleForm.validateField(key);
+    },
+    // 商品保存提交
+    async submitForm() {
+      const { loss_num } = this.ruleForm
+      const { return_num } = this.sitem
+
+      if(Number(loss_num) > Number(return_num)){
+        this.$message.warning("丢失数量不能超过退货数量")
+        return
+      }
+
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          if (this.loading) {
+            return;
+          }
+          this.loading = true;
+          const model = JSON.parse(JSON.stringify(this.ruleForm));
+          let res = await asyncRequest.reorderChildReceive({id:this.sitem.id,...model});
+          this.loading = false;
+
+          if (res && res.code === 0) {
+            this.showModelThis = false;
+            this.$emit("reload");
+          } 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.good_receive_type = e && e.code ? [e.label] : [];
+      this.$refs.ruleForm.validateField("good_receive_type");
+    },
+  },
+};
+</script>

+ 37 - 0
src/views/purchaseIn/beforeReturnGoodWorkOrder/components/work-order-mark.vue

@@ -0,0 +1,37 @@
+<template>
+  <div class="work-order-mark__wrapper">
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px" @click="() => onMark()">保存</el-button>
+  </div>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+import asyncRequest from '@/apis/service/sellOut/beforeReturnGoodWorkOrder'
+
+export default {
+  components: { VueEditor },
+  props: ['sitem'],
+  data: () => ({
+    content: '',
+    loading: false
+  }),
+  methods: {
+    async onMark() {
+      this.loading = true
+      const { code, message } = await asyncRequest.setAfterChildRecord({ record: this.content, id: this.sitem.id })
+      this.loading = false
+
+      switch (code) {
+        case 0:
+          this.content = ''
+          this.$emit('reload')
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 212 - 0
src/views/purchaseIn/beforeReturnGoodWorkOrder/detail.vue

@@ -0,0 +1,212 @@
+<template>
+  <div class="sellReturnDetail pagePadding">
+    <div style="display:flex;justify-content:flex-end;align-items:center">
+        <el-button type="primary" plain size="mini" @click="() => visible = true">退货工单标记</el-button>
+    </div>
+
+    <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) || {})
+                        .label || '--'
+                    "
+                  ></el-tag>
+                </template>
+
+                <template slot="record">
+                  <div class="ql-editor" v-html="sitem.record" />
+                </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="returnWsm">
+                  <span>{{ sitem.return_wsm_name }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li><h3>退货仓库</h3></li>
+                      <li>
+                        <span>编码:</span
+                        ><span>{{ sitem.return_wsm_code }}</span>
+                      </li>
+                      <li>
+                        <span>名称:</span
+                        ><span>{{ sitem.return_wsm_name }}</span>
+                      </li>
+                      <li>
+                        <span>负责人:</span
+                        ><span>{{ sitem.return_contactor_name }}</span>
+                      </li>
+                      <li>
+                        <span>供应商编码:</span
+                        ><span>{{ sitem.return_supplierNo }}</span>
+                      </li>
+                      <li>
+                        <span>供应商名称:</span
+                        ><span>{{ sitem.return_supplierName }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+
+                <template slot="customerName">
+                  <span>{{ sitem.customerName }}</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="2">
+              <show-goods-data-table :type="order_type" :spucode="spuCode" iscgd :newTime="newTime"  />
+            </el-collapse-item>
+
+            <el-collapse-item title="待库管收货" name="1" v-if="sitem && ppowers.includes('1') && String(sitem.status) === '1' && !isSupertube">
+              <wait-stockman :sitem="sitem" @reload="initData" />
+            </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+
+
+        <el-tab-pane label="审批记录" name="2">
+          <process-time-line
+            v-if="newTime !== ''"
+            :newTime="newTime"
+            :type="'THG'"
+            :orderCode="sitem.returnCode"
+          />
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+    <mark-modal :visible.sync="visible" :sitem="sitem" @reload="() => initData()" />
+  </div>
+</template>
+<script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/beforeReturnGoodWorkOrder";
+import { showColumns } from "./components/ShowDataTableColumns";
+import { xs_order_type_options } from "@/assets/js/statusList";
+import WaitStockman from "./components/wait-stockman.vue";
+import MarkModal from "./components/mark-modal.vue";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "deliveryWorkOrderDetail",
+  mixins: [mixinPage, resToken],
+  components: { WaitStockman, MarkModal },
+  computed: {
+    ...mapGetters(['isSupertube']),
+    powers() {
+      const {btnList} = this.$store.getters;
+      const tran = btnList.find((item) => item.menu_route == "beforeReturnGoodWorkOrderDetail" ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "THGD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      activeTabs: "1",
+      showColumns: showColumns,
+      visible: false,
+      statusOptions: [
+        { value: "1", label: "待收货" },
+        { value: "2", label: "已收货" }
+      ],
+      xs_order_type_options,
+      sitem: null, //传给组件
+      order_type: "",
+      spuCode: "",
+      activeNames: ["0", "1", "2", "3", "4", "5", "6"],
+      status: "", //存储详情接口状态
+      statusList: [
+        { value: "1", label: "待收货" },
+        { value: "2", label: "已收货" }
+      ],
+      newTime: "",
+      loading: false,
+      is_stock: "",
+      queryId: "",
+    };
+  },
+  mounted() {
+    this.queryId = this.$route.query.id;
+    this.initData();
+  },
+  methods: {
+    async initData() {
+      const { code, data, message } = await asyncRequest.detail({
+        id: this.queryId,
+        is_authority: '0'
+      });
+      if (code === 0) {
+        const { is_stock, status,order_type, spuCode } = data;
+        this.is_stock = is_stock;
+        this.order_type = order_type
+        this.spuCode = spuCode
+        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>

+ 599 - 0
src/views/purchaseIn/beforeReturnGoodWorkOrder/index.vue

@@ -0,0 +1,599 @@
+<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="3" style="width: 120px">
+                <el-switch 
+                  v-model="parmValue.use_type"
+                  :active-value="usetypeOtions[1].value"
+                  :inactive-value="usetypeOtions[0].value"
+                  :active-text="usetypeOtions[1].label"
+                  :inactive-text="usetypeOtions[0].label"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                />
+              </el-col>
+              <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_source"
+                  filterable
+                  clearable
+                  placeholder="订单来源"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_source_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_type"
+                  filterable
+                  clearable
+                  placeholder="商品类型"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_type_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+
+              <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
+                <search-supplier
+                  :size="'mini'"
+                  style="width: 100%"
+                  :value="parmValue.supplierNo"
+                  :disabled="false"
+                  :placeholder="'供应商名称'"
+                  :names="parmValue.supplierName"
+                  :is-detail="true"
+                  :noDisabled="true"
+                  @searchChange="supplierChange"
+                />
+              </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-row>
+            <el-row style="padding: 10px 0 0 0">
+              <el-col :span="4" style="width: 200px">
+                <el-select
+                  style="width: 100%"
+                  placeholder="状态"
+                  size="mini"
+                  clearable
+                  v-model="parmValue.status"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option label="待收货" value="1" />
+                  <el-option label="已收货" value="2" />
+                </el-select>
+              </el-col>
+              <el-col :span="8" style="width: 502px; padding: 0 0 0 10px">
+                <el-input
+                  placeholder="关键字"
+                  size="mini"
+                  v-model="queryValue"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <template #prepend>
+                    <el-select
+                      style="width: 150px"
+                      v-model="queryKey"
+                      @change="
+                        pageInfo.curr = 1;
+                        parmValue.page = 1;
+                        searchList();
+                      "
+                    >
+                      <el-option value="saleReturnChildCode" label="售前退货工单编码" />
+                      <el-option value="returnCode" label="售前退货单编码" />
+                      <el-option value="orderCode" label="订单编码" />
+                      <el-option value="outChildCode" label="发货工单编码" />
+                      <el-option value="return_wsm_code" label="退货仓库编码" />
+                    </el-select>
+                  </template>
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  ></el-button>
+                </el-input>
+              </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-row>
+          </div>
+        </template>
+        <template #status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="String(scope.row.status) === '1' ? 'warning' : ''"
+            v-text="
+              (statusOptions.find((item) => item.value == String(scope.row.status)) || {})
+                .label || '--'
+            "
+          ></el-tag>
+        </template>
+
+        <template #returnWsm="{ scope }">
+          <el-popover placement="top" width="360" trigger="hover">
+            <i class="el-icon-warning-outline" slot="reference"></i>
+            <ul>
+              <li><h3>退货仓库</h3></li>
+              <li>
+                <span>编号:</span><span>{{ scope.row.return_wsm_code }}</span>
+              </li>
+              <li>
+                <span>名称:</span><span>{{ scope.row.return_wsm_name }}</span>
+              </li>
+              <li>
+                <span>负责人:</span><span>{{ scope.row.return_contactor_name }}</span>
+              </li>
+              <li>
+                <span>供应商编码:</span><span>{{ scope.row.return_supplierNo }}</span>
+              </li>
+              <li>
+                <span>供应商名称:</span><span>{{ scope.row.return_supplierName }}</span>
+              </li>
+            </ul>
+          </el-popover>
+          <span>{{ scope.row.return_wsm_name }}</span>
+        </template>
+
+        <template #type="{ scope }">
+          <el-tag size="mini">{{
+            scope.row.type === "1" ? "未发货退货" : "售后申请"
+          }}</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 #use_type="{ scope }">
+          <el-tag size="mini">
+            {{
+              (usetypeOtions.find(({ value }) => value === scope.row.use_type) || {})
+                .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('beforeReturnGoodWorkOrderDetail', scope.row.id)"
+            ></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 asyncRequest from "@/apis/service/sellOut/beforeReturnGoodWorkOrder";
+import {
+  xs_order_type_options,
+  xs_order_source_options,
+  usetypeOtions,
+} from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper";
+import urlConfig from "@/apis/url-config";
+import { mapGetters } from "vuex";
+import columns from "./columns";
+
+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 == "beforeReturnGoodWorkOrder"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      xs_order_type_options,
+      xs_order_source_options,
+      fileUrl: urlConfig.baseURL,
+      usetypeOtions,
+      select: "outChildCode", //默认选择下拉框
+      s_input: "", //搜索框内容
+      select_list: [],
+      supplierNo: [],
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { value: "1", label: "待收货" },
+        { value: "2", label: "已收货" },
+      ],
+      queryKey: "saleReturnChildCode",
+      queryValue: "",
+      loading: false,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        order_type: "",
+        supplierName:"",
+        supplierNo:"",
+        saleReturnChildCode: "",
+        status: "",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        order_source: "",
+        use_type: "1",
+      },
+      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.pageInfo = {
+        size: size,
+        curr: page,
+        total: 0,
+      };
+
+      //多选条件
+      this.queryKey = this.parmValue.queryKey;
+      this.queryValue = this.parmValue.queryValue;
+    } else {
+      this.select = "outChildCode";
+    }
+
+    this.searchList();
+  },
+
+  methods: {
+    async supplierChange(e) {
+      const { code, label } = e;
+      this.parmValue.supplierNo = code ? [code] : [];
+      this.parmValue.supplierName = label
+      this.searchList();
+    },
+    customer_code_change(e) {
+      if (e && e.code) {
+        this.parmValue.customer_code = [e.code];
+      } else {
+        this.parmValue.customer_code = [];
+      }
+    },
+    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.parmValue.supplierNo)
+              ? this.parmValue.supplierNo[0]
+              : this.parmValue.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.queryKey = this.queryKey;
+        this.parmValue.queryValue = this.queryValue;
+        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: "", //申请人
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        order_source: "",
+        use_type: "1",
+      };
+
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+
+      this.queryValue = "";
+      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"];
+      delete model["supplierName"];
+
+      const res = await asyncRequest.list({
+        ...model,
+        [this.select]: this.s_input,
+        [this.queryKey]: this.queryValue,
+        customer_code: Array.isArray(this.parmValue.customer_code)
+          ? this.parmValue.customer_code[0]
+          : this.parmValue.customer_code,
+        supplierNo: Array.isArray(this.parmValue.supplierNo) ? this.parmValue.supplierNo[0] : this.parmValue.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 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/purchaseIn/beforeReturnGoodWorkOrder/售前退货工单管理


+ 287 - 0
src/views/purchaseIn/deliveryWorkOrder/columns.js

@@ -0,0 +1,287 @@
+export default [
+
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    width: '160'
+  },
+  {
+    prop: 'outCode',
+    label: '发货单编号',
+    width: '160'
+  },
+  {
+    prop: 'orderCode',
+    label: '销售订单编号',
+    width: '160'
+  },
+  {
+    prop: 'cgdNo',
+    label: '采购单编号',
+    width: '160'
+  },
+  {
+    prop: 'good_name',
+    label: '产品名称',
+    width: '160'
+  },
+  {
+    prop: 'has_account',
+    label: '供应商端',
+    width: '80',
+    _slot_: 'has_account'
+  },
+  {
+    prop: 'use_type',
+    label: '平台类型',
+    _slot_: 'use_type',
+    width: '70'
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    width: '85px'
+  },
+  {
+    prop: 'order_type',
+    label: '商品类型',
+    _slot_: 'order_type',
+    width: '100'
+  },
+  {
+    prop: 'order_source',
+    label: '订单来源',
+    _slot_: 'order_source',
+    width: '100'
+  },
+  {
+    prop: 'num',
+    label: '总数量',
+    width: '100'
+  },
+  {
+    prop: 'wsm_code',
+    label: '仓库编号',
+    width: '155'
+  },
+  {
+    prop: 'wsm_name',
+    label: '仓库名称',
+    width: '160'
+  },
+  {
+    prop: 'sendtime',
+    label: '发货时间',
+    width: '160'
+  },
+  {
+    prop: 'spuCode',
+    label: '商品成本编码',
+    width: '160'
+  },
+  {
+    prop: 'skuCode',
+    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: 'send_status',
+  //   label: '分单状态',
+  //   _slot_: 'send_status',
+  //   width: '120px'
+  // },
+  {
+    prop: 'apply_name',
+    label: '申请人',
+    width: '80'
+  },
+  {
+    prop: 'addtime',
+    label: '下单时间',
+    width: 150
+  },
+
+  {
+    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	状态
+export const sendOutOrderColumns = [
+  {
+    type: 'index',
+    label: '序号',
+    width: '70px'
+  },
+  {
+    prop: 'value0',
+    label: '发货工单号',
+    'min-width': '156px'
+  },
+  {
+    prop: 'value1',
+    label: '发货单编号',
+    'min-width': '156px'
+  },
+  {
+    prop: 'value2',
+    label: '销售订单编号',
+    'min-width': '156px'
+  },
+  // {
+  //   prop: 'value3',
+  //   label: '订单编号',
+  //   'min-width': '156px'
+  // },
+  // {
+  //   prop: 'value11',
+  //   label: '',
+  //   'min-width': '180px'
+  // },
+  {
+    prop: 'value7',
+    label: '总数量',
+    'min-width': '100px'
+  },
+  // {
+  //   prop: 'value8',
+  //   label: '仓库编号',
+  //   'min-width': '100px'
+  // },
+  // {
+  //   prop: 'value9',
+  //   label: '仓库名称',
+  //   'min-width': '100px'
+  // },
+  // {
+  //   prop: 'value10',
+  //   label: '商品成本编码',
+  //   'min-width': '100px'
+  // },
+  // {
+  //   prop: 'value11',
+  //   label: '商品上线编码',
+  //   'min-width': '100px'
+  // },
+  // {
+  //   prop: 'value12',
+  //   label: '商品名称',
+  //   'min-width': '100px'
+  // },
+  {
+    prop: 'value22',
+    label: '物流公司',
+    'min-width': '150px'
+  },
+  {
+    prop: 'value23',
+    label: '物流单号',
+    'min-width': '150px'
+  },
+  {
+    prop: 'value24',
+    label: '物流费用',
+    'min-width': '140px'
+  }
+  // {
+  //   prop: 'value25',
+  //   label: '收货地址',
+  //   'min-width': '140px'
+  // },
+  // {
+  //   prop: 'value26',
+  //   label: '收货人',
+  //   'min-width': '140px'
+  // },
+  // {
+  //   prop: 'value27',
+  //   label: '收货联系人',
+  //   'min-width': '140px'
+  // },
+  // {
+  //   prop: 'value28',
+  //   label: '联系方式',
+  //   'min-width': '140px'
+  // },
+  // {
+  //   prop: 'value29',
+  //   label: '采购单号',
+  //   'min-width': '140px'
+  // }
+]
+export const head = [
+  '发货工单号',
+  '发货单编号	',
+  '销售订单编号	',
+  '供应商端	',
+  '状态	',
+  '商品类型	',
+  '订单来源	',
+  '总数量	',
+  '仓库编号	',
+  '仓库名称	',
+  '商品成本编码	',
+  '商品上线编码	',
+  '商品名称	',
+  '业务公司编号	',
+  '业务公司名称	',
+  '客户编号	',
+  '客户名称	',
+  '供应商编号	',
+  '供应商名称	',
+  '下单时间	',
+  '申请人	',
+  '对接类型	',
+  '物流公司	',
+  '物流单号	',
+  '物流费用',
+  '收货地址',
+  '收货联系人',
+  '联系方式',
+  '采购单号',
+  '备注'
+]
+
+console.log(head.length)

+ 86 - 0
src/views/purchaseIn/deliveryWorkOrder/components/ShowDataTableColumns.js

@@ -0,0 +1,86 @@
+
+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: 'wsm_code',
+    label: '仓库名称',
+    _slot_: 'wsm_code',
+    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: 12
+  },
+  {
+    prop: 'post_fee',
+    label: '物流费用',
+    span: 12
+  },
+  {
+    prop: 'remark',
+    label: '备注',
+    span: 24
+  }
+]
+
+export { showColumns }

+ 281 - 0
src/views/purchaseIn/deliveryWorkOrder/components/express.vue

@@ -0,0 +1,281 @@
+<template>
+  <el-form
+    ref="ruleForm"
+    v-loading="loading"
+    :model="ruleForm"
+    :rules="rules"
+    :size="'mini'"
+    status-icon
+    label-width="95px"
+    class="demo-ruleForm"
+  >
+    <el-row>
+      <el-col :span="18">
+        <el-form-item label="物流费用" prop="post_fee">
+          <digital-input
+            :values="ruleForm.post_fee"
+            :placeholder="'物流费用'"
+            :min="0"
+            :disabled="type === 'view' || type === 'post_fee'"
+            :max="100000000000"
+            :position="'right'"
+            :precision="2"
+            :size="'mini'"
+            :controls="false"
+            :append="'元'"
+            @reschange="number_change($event, 'post_fee')"
+          />
+        </el-form-item>
+        <el-form-item label="物流公司" prop="post_name">
+          <search-express
+            :value="ruleForm.post_name"
+            :placeholder="'物流公司'"
+            :names="''"
+            :size="'mini'"
+            :order_source="order_source"
+            :is-detail="false"
+            @searchChange="handleCompany"
+          /> </el-form-item>
+        <el-col
+          v-for="(domain, index) in ruleForm.post_code"
+          :key="domain.key"
+          :span="12"
+        >
+          <el-form-item
+            :key="domain.key"
+            :label="'物流单号' + (index + 1)"
+            :prop="'post_code.' + index + '.value'"
+            :rules="const_post"
+          >
+            <el-input
+              v-model="domain.value"
+              placeholder="物流单号"
+              minlength="9"
+              maxlength="20"
+            >
+              <el-button
+                slot="append"
+                icon="el-icon-delete"
+                @click.prevent="removeDomain(index)"
+              />
+            </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24" style="text-align: right; padding: 0 0 16px 0">
+          <el-button
+            type="warning"
+            :size="'mini'"
+            icon="el-icon-circle-plus-outline"
+            @click="addDomain"
+          >添加快递单号</el-button>
+          <el-button
+            type="primary"
+            :size="'mini'"
+            icon="el-icon-search"
+            @click="submitForm"
+          >保 存
+          </el-button>
+        </el-col>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+import asyncRequest from '@/apis/service/sellOut/deliveryWorkOrder'
+import resToken from '@/mixins/resToken'
+import { isnumber, isNumeric } from '@/utils/validate'
+export default {
+  name: 'WsmInOrderAdd',
+  mixins: [resToken],
+  props: ['id', 'sitem', 'newTime'],
+  data() {
+    const validate_num = (rule, value, callback) => {
+      const { required } = rule
+      if (required && value === '') {
+        callback(new Error('不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    const validateCode = (rule, value, callback) => {
+      const { required } = rule
+      const l = value.length
+      if (required) {
+        if (value === '') {
+          callback(new Error('物流单号不能为空!'))
+        } else if (l < 9 || l > 20) {
+          callback(new Error('仅支持纯数字或字母数字组合(9~20位)!'))
+        } else if (isnumber(value)) {
+          callback()
+        } else if (!isNumeric(value)) {
+          console.log(!isNumeric(value))
+          callback(new Error('仅支持纯数字或字母数字组合(9~20位)!'))
+        } else {
+          callback()
+        }
+      } else {
+        callback()
+      }
+    }
+
+    return {
+      loading: true,
+      order_source: '',
+      const_post: {
+        required: true,
+        validator: validateCode,
+        trigger: 'blur'
+      },
+      ruleForm: {
+        post_name: [],
+        post_code: [
+          {
+            value: '',
+            key: Date.now()
+          }
+        ],
+        post_fee: ''
+      },
+      rules: {
+        post_name: {
+          type: 'array',
+          required: true,
+          trigger: 'change',
+          message: '请输入物流公司'
+        },
+        post_code: {
+          required: true,
+          validator: validateCode,
+          trigger: 'blur'
+        },
+        post_fee: {
+          required: true,
+          validator: validate_num,
+          trigger: 'blur'
+        }
+      }
+    }
+  },
+  watch: {
+    newTime: function(val) {
+      if (val) {
+        this.initForm()
+      }
+    }
+  },
+  mounted() {
+    this.initForm()
+  },
+  methods: {
+    async initForm() {
+      this.loading = true
+      await this.resetForm()
+      this.loading = false
+    },
+    removeDomain(index) {
+      if (this.ruleForm.post_code.length === 1) {
+        this.$message.warning('至少填写一个快递单号!')
+        return
+      }
+      if (index !== -1) {
+        this.ruleForm.post_code.splice(index, 1)
+      }
+    },
+    addDomain() {
+      if (this.ruleForm.post_code.length >= 10) {
+        this.$message.warning('最多只能添加10条物流单号!')
+        return
+      }
+
+      this.ruleForm.post_code.push({
+        value: '',
+        key: Date.now()
+      })
+    },
+    // 初始化表单
+    async resetForm() {
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields()
+          this.$refs.ruleForm.clearValidate()
+
+          const {
+            post_code,
+            post_name,
+            post_fee,
+            remark,
+            order_source
+          } = this.sitem
+          this.order_source = order_source
+          this.ruleForm = {
+            post_name: post_name ? [post_name] : [],
+            post_code: [
+              {
+                value: post_code || '',
+                key: Date.now()
+              }
+            ],
+            post_fee: post_fee || '',
+            remark: remark || ''
+            // sendtime: "",
+          }
+        }
+      })
+    },
+    // 保存更改
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async(valid) => {
+        if (valid) {
+          if (this.loading) {
+            return
+          }
+          this.loading = true
+          const { post_code, post_name, post_fee } = this.ruleForm
+          const { outChildCode } = this.sitem
+
+          const model = {
+            list: [{
+              post_fee,
+              outChildCode,
+              post_name: Array.isArray(post_name) ? post_name[0] : post_name,
+              post_code: post_code.map(({ value }) => value).join(',')
+            }]
+          }
+
+          const { code, message } = await asyncRequest.express(model)
+          this.loading = false
+          if (code === 0) {
+            this.$notify.success({
+              title: '添加成功',
+              message: ''
+            })
+            this.$emit('refresh')
+          } else if (code >= 100 && code <= 104) {
+            await this.logout()
+          } else {
+            this.$message.warning(message)
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    handleCompany(e) {
+      const { code, id, label } = e
+      this.ruleForm.post_name = label ? [label] : []
+      this.$refs.ruleForm.validateField('post_name')
+    },
+    number_change(e, key) {
+      this.ruleForm[key] = e + '' || '0'
+      this.$refs.ruleForm.validateField(key)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.account {
+}
+</style>

+ 229 - 0
src/views/purchaseIn/deliveryWorkOrder/detail.vue

@@ -0,0 +1,229 @@
+<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) || {})
+                        .label || '--'
+                    "
+                  />
+                </template>
+                <template slot="order_type">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (
+                        xs_order_type_options.find(
+                          (item) => item.id == sitem.order_type
+                        ) || {}
+                      ).label || '--'
+                    "
+                  />
+                </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>
+
+                <template slot="wsm_code">
+                  <span>{{ sitem.wsm_name }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>仓库编号:</span
+                        ><span>{{ sitem.wsm_code }}</span>
+                      </li>
+                      <li>
+                        <span>仓库负责人:</span
+                        ><span>{{ sitem.contactor_name }}</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="2">
+              <show-goods-data-table
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :type="sitem.order_type"
+                :skucode="sitem.skuCode"
+                :spucode="sitem.spuCode"
+              />
+            </el-collapse-item>
+
+            <el-collapse-item title="待库管发货" name="2"  v-if="canSend && sitem.status === '1' && !isSupertube && ppowers.includes('1')">
+              <express-node @refresh="() => initData()" :sitem="sitem" />
+            </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+
+        <el-tab-pane label="审批记录" name="2">
+          <process-time-line
+            v-if="newTime !== ''"
+            :newTime="newTime"
+            :type="'FHGD'"
+            :orderCode="queryId"
+          />
+        </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/deliveryWorkOrder";
+import { showColumns } from "./components/ShowDataTableColumns";
+import { xs_order_type_options } from "@/assets/js/statusList";
+import ExpressNode from "./components/express.vue"
+import { mapGetters } from "vuex";
+export default {
+  name: "deliveryWorkOrderDetail",
+  mixins: [mixinPage, resToken],
+  components: { ExpressNode },
+  data() {
+    return {
+      showColumns,
+      activeTabs: "1",
+      goodDetail:null,
+      statusOptions: [
+        { value: "1", label: "待发货" },
+        { value: "2", label: "发货完成" },
+        // { value: "3", label: "已收货" },
+        // { value: "4", label: "已全部收货" },
+        { value: "5", 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.initData();
+  },
+  computed:{
+    ...mapGetters(["isSupertube"]),
+    canSend(){
+      const { id:userId } = this.userInfo || {};
+      const { contactor:manangerUserId ,order_type ,has_account } = this.sitem || {};
+      const isStock = String(order_type) === '1'
+
+      /* 不是库存品&&没有供应商端账号 **/
+      if(!isStock && String(has_account) !== '1'){
+        return true
+      }
+
+      /* 库存品&&用户id和库管id一致 **/
+      if(!userId || !manangerUserId) return false
+      return userId === manangerUserId
+    },
+    ...mapGetters(['isSupertube','userInfo']),
+    powers() {
+      const { btnList } = this.$store.getters;
+      const tran = btnList.find((item) => item.menu_route == "deliveryWorkOrderDetail" ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "FHGD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    }
+  },
+  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.queryId = this.s
+        this.getNewTime();
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
+  },
+};
+</script>
+

+ 699 - 0
src/views/purchaseIn/deliveryWorkOrder/index.vue

@@ -0,0 +1,699 @@
+<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="4" style="width: 120px">
+                <el-switch 
+                  v-model="parmValue.use_type"
+                  :active-value="usetypeOtions[1].value"
+                  :inactive-value="usetypeOtions[0].value"
+                  :active-text="usetypeOtions[1].label"
+                  :inactive-text="usetypeOtions[0].label"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                />
+              </el-col>
+              <!-- 时间区间 -->
+              <el-col :span="6" style="width: 303px; padding: 0 0 0 10px">
+                <period-date-picker
+                  :type="1"
+                  :width="'135px'"
+                  :size="searchSize"
+                  :start="parmValue.start"
+                  :end="parmValue.end"
+                  @timeReturned="handleTime"
+                />
+              </el-col>
+              <el-col :span="3" style="width: 240px; padding: 0 0 0 10px">
+                <search-customer
+                  :value="parmValue.customer_code"
+                  :size="'mini'"
+                  style="width: 100%"
+                  :names="parmValue.customerName"
+                  :placeholder="'企业客户'"
+                  :disabled="false"
+                  :is-detail="true"
+                  @searchChange="customer_code_change"
+                />
+              </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-row>
+
+            <el-row style="margin-top: 10px">
+              <el-col :span="3" style="width: 200px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.status"
+                  filterable
+                  clearable
+                  placeholder="状态"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in statusOptions"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 151px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_source"
+                  filterable
+                  clearable
+                  placeholder="订单来源"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_source_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 151px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_type"
+                  filterable
+                  clearable
+                  placeholder="商品类型"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_type_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+
+              <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
+                <search-supplier
+                  :size="'mini'"
+                  style="width: 100%"
+                  :value="parmValue.supplierNo"
+                  :names="parmValue.supplierName"
+                  :disabled="false"
+                  :placeholder="'供应商名称'"
+                  :isDetail="true"
+                  :noDisabled="true"
+                  @searchChange="supplierChange"
+                />
+              </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-row>
+
+            <el-row style="padding: 10px 0 0 0">              
+              <el-col :span="6" style="width: 502px;margin-left: 0px;">
+                <el-input
+                  clearable
+                  placeholder="关键字"
+                  v-model="s_input"
+                  maxlength="40"
+                  :size="searchSize"
+                  class="input-with-select"
+                >
+                  <el-select
+                    v-model="select"
+                    style="width: 150px"
+                    slot="prepend"
+                    placeholder="关键字类型"
+                  >
+                    <el-option label="销售订单编号" value="orderCode" />
+                    <el-option label="采购单编号" value="cgdNo" />
+                    <el-option label="发货工单编号" value="outChildCode" />
+                    <el-option label="商品成本编号" value="spuCode" />
+                    <el-option label="发货单编号" value="outCode" />
+                    <el-option label="商品上线编号" value="skuCode" />
+                    <el-option label="申请人" value="apply_name" />
+                  </el-select>
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  ></el-button>
+                </el-input>
+              </el-col>
+              
+              <el-col :span="5">
+                <el-select size="mini" style="width:104%;margin-left: 10px;" placeholder=""  v-model="parmValue.IsByMe" @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    ">
+                  <el-option label="与我相关" value="0" />
+                  <el-option label="由我执行" value="1" />
+                </el-select>
+              </el-col>
+
+              <div style="margin-left: 10px; float: right">
+                <el-button
+                  v-if="powers.includes('090') && !isSupertube"
+                  type="primary"
+                  size="mini"
+                  @click="routeGoto('deliveryWorkOrderSend')"
+                  >批量发货</el-button
+                >
+              </div>
+
+              <!-- v-if="powers.includes('087') && !isSupertube" -->
+              <div style="float: right" >
+                <el-button type="primary" size="mini" @click="handleExport"
+                  >发货工单导出</el-button
+                >
+              </div>
+              <!-- <el-col :span="4" style="margin-left: 10px;margin-top:10px">
+                  <el-select placeholder="供应商端" clearable size="mini"  v-model="parmValue.has_account"  
+                    @change="
+                        pageInfo.curr = 1;
+                        parmValue.page = 1;
+                        searchList();
+                      "
+                  >
+                    <el-option value="0" label="未开通" />
+                    <el-option value="1" label="已开通"/>
+                  </el-select>
+                </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 #use_type="{ scope }">
+          <el-tag size="mini">
+            {{
+              (usetypeOtions.find(({ value }) => value === scope.row.use_type) || {})
+                .label || "---"
+            }}
+          </el-tag>
+        </template>
+
+        <template #has_account="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="
+              (
+                has_account_list.find(
+                  (item) => item.code == scope.row.has_account + ''
+                ) || {}
+              ).type || '--'
+            "
+            v-text="
+              (
+                has_account_list.find(
+                  (item) => item.code == scope.row.has_account + ''
+                ) || {}
+              ).name || '--'
+            "
+          ></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('deliveryWorkOrderDetail', 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/deliveryWorkOrder";
+import { mapGetters } from "vuex";
+import urlConfig from "@/apis/url-config";
+import {
+  xs_order_type_options,
+  xs_order_source_options,
+  has_account_list,
+  usetypeOtions,
+} from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper";
+
+export default {
+  name: "sellReturn",
+  mixins: [mixinPage, resToken, companyHelper],
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size", "isSupertube"]),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "deliveryWorkOrder"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    dpowers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "deliveryWorkOrderDetail"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      xs_order_type_options,
+      xs_order_source_options,
+      has_account_list,
+      usetypeOtions,
+      supplierName:"",
+      fileUrl: urlConfig.baseURL,
+      select: "outChildCode", //默认选择下拉框
+      s_input: "", //搜索框内容
+      select_list: [],
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { value: "1", label: "待发货" },
+        { value: "2", label: "发货完成" },
+        // { value: "3", label: "已收货" },
+        // { value: "4", label: "已全部收货" },
+        { value: "5", label: "已取消" },
+      ],
+      loading: false,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        IsByMe:"1",
+        supplierName:"",
+        supplierNo:"",
+        customerName:"",
+        status: "",
+        has_account: "",
+        customer_code: [],
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        company_name: "",
+        good_code: "",
+        skuCode: "",
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        order_type: "",
+        use_type: "1",
+      },
+      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.parmValue.supplierNo = code ? [code] : [];
+      this.parmValue.supplierName = label;
+      this.searchList();
+    },
+    customer_code_change(e) {
+      if (e && e.code) {
+        this.parmValue.customer_code = [e.code];
+        this.parmValue.customerName = e.label
+      } else {
+        this.parmValue.customer_code = [];
+        this.parmValue.customerName = ""
+      }
+      this.searchList();
+    },
+    handleExport() {
+      if (!this.loading) {
+        this.loading = true;
+        let httpType = `application/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.parmValue.supplierNo)
+              ? this.parmValue.supplierNo[0]
+              : this.parmValue.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 = {
+        IsByMe:"1",
+        order_type: "",
+        company_name: "", //申请人部门
+        good_code: "",
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        use_type: "1",
+      };
+
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        total: 0,
+        curr: 1,
+      };
+
+      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 {supplierName,customerName,...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.parmValue.supplierNo) ? this.parmValue.supplierNo[0] : this.parmValue.supplierNo,
+        needRela: 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>

+ 308 - 0
src/views/purchaseIn/deliveryWorkOrder/sendOutOrder.vue

@@ -0,0 +1,308 @@
+<template>
+  <div class="orderImport pagePadding" v-loading="loading">
+    <div v-if="tableData && tableData.length > 0" class="tr" style="padding: 10px 0 0 0">
+      <el-button @click="cancel" :size="'mini'">取消</el-button>
+      <el-button type="primary" @click="submit" :size="'mini'">提交</el-button>
+    </div>
+    <div v-else>
+      <upload-excel :on-success="handleSuccess" :before-upload="beforeUpload" />
+    </div>
+    <div>
+      <el-alert title="多物流单号请用逗号','隔开" type="warning" :closable="false">
+      </el-alert>
+    </div>
+    <ex-table
+      :columns="columns"
+      :table="table"
+      :data="tableData"
+      style="margin: 15px 0 0 0"
+    >
+    </ex-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/apis/service/sellOut/deliveryWorkOrder";
+import { sendOutOrderColumns, head } from "./columns";
+import { isnumber, isNumeric } from "@/utils/validate";
+import resToken from "@/mixins/resToken";
+export default {
+  mixins: [resToken],
+  name: "orderImport",
+  data() {
+    return {
+      code_msg: "物流单号必传,且支持纯数字或字母数字组合(9~20位)!",
+      ruleForm: {
+        order_addr: [], //收货地址
+      },
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        "max-height": "800px",
+        // _defaultHeader_: ["setcol"],
+      },
+      tableData: [],
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      head,
+      loading: false,
+      // 表格 - 列参数
+      columns: sendOutOrderColumns,
+
+      //按钮锁
+      btnFlag: false,
+
+      //编辑全局锁
+      editBtnFlag: false,
+    };
+  },
+  methods: {
+    beforeUpload(file) {
+      const isLt1M = file.size / 1024 < 500;
+      if (isLt1M) {
+        return true;
+      }
+      this.$message({
+        message: "请不要上传大于500KB的文件.",
+        type: "warning",
+      });
+      return false;
+    },
+    handleSuccess({ results, header }) {
+      // alert(this.head.length, header.length)
+      // console.log(results)
+      if (!this.loading) {
+        this.loading = true;
+        if (results.length === 0) {
+          this.$message.error("表格无有效数据!");
+          this.loading = false;
+          return;
+        }
+
+        console.log(this.head.length,header.length);
+        if (this.head.length !== header.length) {
+          this.$message.error("表头与导入模板不匹配!");
+          this.loading = false;
+          return;
+        }
+        let hederOk = true;
+        this.head.forEach((v1, i1) => {
+          if (v1.replace(/\s*/g, "") !== header[i1].replace(/\s*/g, "")) {
+            hederOk = false;
+          }
+        });
+
+        if (!hederOk) {
+          this.$message.error("表头与导入模板不匹配!");
+          this.loading = false;
+          return;
+        }
+        this.tableData = [];
+        let list = results;
+
+        try {
+          list.forEach((obj, index) => {
+            let model = {};
+            let arr = Object.values(obj);
+            arr.forEach((key, ii) => {
+              let key_n = (key ?? "") + "";
+              key_n = key_n.replace(/\s+/g, "");
+              const s = /\\|\/|\?|\?|\*|\"|\“|\”|\'|\‘|\’|\,|\;|\?|\<|\>|\{|\}|\[|\]|\[|\]|\:|\:|\.|\^|\$|\!|\~|\`|\|/g;
+
+              Object.defineProperty(model, `value${ii}`, {
+                value: ii === 28 ? key_n.replace(s, ",") : key_n,
+              });
+            });
+            this.tableData.push(model);
+            // console.log(this.tableData);
+          });
+        } catch (e) {
+          console.log(e);
+        }
+        this.loading = false;
+      }
+    },
+    //取消
+    cancel() {
+      this.tableData = [];
+    },
+    validateCode(str) {
+      let arr = str.split(",");
+      let isok = true;
+      arr.forEach((value) => {
+        const l = value.length;
+        let res = true;
+        // else if (value === "0") {//之前支持0
+        //   res = true;
+        // }
+        if (value === "") {
+          res = false;
+        } else if (l >= 9 && l <= 20) {
+          if (isnumber(value)) {
+            res = true;
+          } else if (!isNumeric(value)) {
+            res = false;
+          } else {
+            res = true;
+          }
+        } else {
+          isok = false;
+        }
+        if (!res) {
+          isok = false;
+        }
+      });
+      return isok;
+    },
+
+    //提交
+    async submit() {
+      if (!this.loading) {
+        this.loading = true;
+        if (this.tableData.length === 0) {
+          this.$message.warning("导入数据不能为空");
+          this.loading = false;
+          return;
+        }
+
+        // if(this.tableData.length > 100){
+        //   this.$message.warning("导入数据最多不能超过100条");        
+        //   this.loading = false
+        // }
+
+        let isok = true,
+          list = [],
+          is_codeok = true;
+
+        this.tableData.forEach((key, index) => {
+          if (
+            key["value0"] === "" ||
+            key["value22"] === "" ||
+            key["value23"] === "" ||
+            key["value24"] === ""
+
+            // key['value25'] === "" ||
+            // key['value26'] === "" ||
+            // key['valye27'] === "" ||
+            // key['value28'] === "" ||
+            // key['value29'] === ""
+          ) {
+            isok = false;
+          }
+
+          let ketitem = {
+            outChildCode: key["value0"],
+            post_name: key["value22"],
+            post_code: key["value23"],
+            post_fee: key["value24"],
+          };
+
+          if (!this.validateCode(key["value23"])) {
+            is_codeok = false;
+          }
+          list.push(ketitem);
+        });
+
+        if (!isok) {
+          this.$notify.warning({
+            title: "以下字段不能为空!",
+            message:
+              "发货工单号/发货工单物流公司/发货工单物流单号/发货工单物流费用"
+          });
+          this.loading = false;
+          return;
+        }
+        if (!is_codeok) {
+          this.$notify.warning({
+            title: "部分物流单号不符合规则!",
+            message: this.code_msg,
+          });
+          this.loading = false;
+          return;
+        }
+        let model = {
+          list: JSON.parse(JSON.stringify(list)),
+        };
+      
+        
+        const { code, data, message } = await asyncRequest.express(model);
+        this.loading = false;
+        if (code === 0) {
+          this.$notify.success({
+            title: "导入成功!",
+            message: "",
+          });
+          this.tableData = [];
+          // await this.routeReGoto("sellOutOrder", {});
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else if (code == 1003) {
+          this.showal(data, message, "");
+        } else if (code == 1005) {
+          this.showal(data, message, "outCode");
+        } else if (code == 1011) {
+          this.showal(data, message, "outCode");
+        } else {
+          this.$message.warning(message);
+        }
+      }
+    },
+    showal(list, message, code) {
+      let htmlList = "<ul>";
+      list.forEach((v) => {
+        htmlList += `<li>${code !== "" ? v[code] : v}</li>`;
+      });
+      htmlList += "</ul>";
+      this.$notify({
+        title: message,
+        dangerouslyUseHTMLString: true,
+        message: htmlList,
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.box {
+  width: 100%;
+  // padding-top: 50px;
+  box-sizing: border-box;
+  // height: 100vh;
+  // overflow: hidden;
+  background: #fff;
+}
+.con {
+  width: 100%;
+  margin: 0px auto;
+  background: #fff;
+  // padding: 50px;
+  box-sizing: border-box;
+
+  h1 {
+    margin-bottom: 20px;
+    margin-top: 20px;
+    font-size: 16px;
+    color: #333;
+  }
+}
+// .tab{
+//   width: 100%;
+//   overflow: hidden;
+//   margin: auto;
+//   box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
+//   padding: 30px;
+
+// }
+.btn {
+  width: 50%;
+  margin: 50px auto 0;
+  display: flex;
+  justify-content: space-around;
+}
+</style>

+ 0 - 0
src/views/purchaseIn/deliveryWorkOrder/发货工单管理


+ 124 - 0
src/views/purchaseIn/returnGoodWorkOrder/columns.js

@@ -0,0 +1,124 @@
+export default [
+  {
+    prop: 'id',
+    label: 'ID',
+    width: '100px'
+  },
+  {
+    prop: 'returnCode',
+    label: '售后申请单号',
+    width: '160'
+  },
+  {
+    prop: 'outChildCode',
+    label: '发货工单编号',
+    width: '160px'
+  },
+  {
+    prop: 'outCode',
+    label: '发货单编号',
+    width: '160'
+  },
+  {
+    prop: 'orderCode',
+    label: '订单编号',
+    width: '160px'
+  },
+  {
+    prop: 'type',
+    label: '仓库类型',
+    _slot_: 'stock_type',
+    width: '100px'
+  },
+  {
+    prop: 'use_type',
+    label: '平台类型',
+    _slot_: 'use_type',
+    width: '80'
+  },
+  {
+    prop: 'order_source',
+    label: '订单来源',
+    _slot_: 'order_source',
+    width: '100'
+  },
+  {
+    prop: 'order_type',
+    label: '商品类型',
+    _slot_: 'order_type',
+    width: '100px'
+  },
+  {
+    prop: 'return_num',
+    label: '售后申请总数量',
+    width: '110px'
+  },
+  {
+    label: '最终入库数量',
+    _slot_: 'stcok_in',
+    width: '100px'
+  },
+  {
+    prop: 'good_code',
+    label: '商品编码',
+    width: '160px'
+  },
+  {
+    prop: 'good_name',
+    label: '商品名称',
+    width: '160px'
+  },
+  {
+    prop: 'return_wsm_name',
+    label: '退货仓库名称',
+    width: '130px',
+    _slot_: 'returnWsm'
+  },
+  {
+    prop: 'return_contactor_name',
+    label: '退货仓库负责人',
+    width: '110px'
+  },
+  {
+    prop: 'send_wsm_name',
+    label: '发货仓库名称',
+    width: '130px',
+    _slot_: 'sendWsm'
+  },
+  {
+    prop: 'send_contactor_name',
+    label: '发货仓库负责人',
+    width: '110px'
+  },
+  {
+    prop: 'companyNo',
+    label: '业务公司编号',
+    width: '150px'
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司名称',
+    width: '150px'
+  },
+  {
+    prop: 'apply_name',
+    label: '申请人',
+    width: '70px'
+  },
+  {
+    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	状态

+ 102 - 0
src/views/purchaseIn/returnGoodWorkOrder/components/ShowDataTableColumns.js

@@ -0,0 +1,102 @@
+
+const showColumns = [
+  {
+    prop: 'returnCode',
+    label: '售后申请单号',
+    span: 7
+  },
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    span: 7
+  },
+  {
+    prop: 'type',
+    label: '仓库类型',
+    span: 4,
+    _slot_: 'stock_type'
+  },
+  // {
+  //   prop: 'status',
+  //   label: '状态',
+  //   _slot_: 'status',
+  //   span: 6
+  // },
+  {
+    prop: 'apply_name',
+    label: '创建人',
+    span: 6
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司',
+    _slot_: 'companyName',
+    span: 12
+  },
+  {
+    prop: 'customer_code',
+    label: '客户公司',
+    _slot_: 'customer',
+    span: 12
+  },
+  {
+    prop: 'send_wsm_code',
+    label: '发货仓库',
+    _slot_: 'sendWsm',
+    span: 12
+  },
+  {
+    prop: 'return_wsm_code',
+    label: '退货仓库',
+    _slot_: 'returnWsm',
+    span: 12
+  },
+  // {
+  //   prop: 'sale_price',
+  //   label: '销售价格',
+  //   span: 4
+  // },
+  // {
+  //   prop: 'total_price',
+  //   label: '总价',
+  //   span: 4
+  // },
+  // {
+  //   prop: 'num',
+  //   label: '下单数量',
+  //   span: 4
+  // },
+  {
+    prop: 'send_num',
+    label: '发货数量',
+    span: 4
+  },
+  {
+    prop: 'return_num',
+    label: '退货数量',
+    span: 4
+  },
+  {
+    prop: 'loss_num',
+    label: '丢失数量',
+    span: 4
+  },
+  {
+    prop: 'addtime',
+    label: '创建时间',
+    span: 12
+  },
+  {
+    prop: 'remark',
+    label: '备注',
+    span: 24
+  },
+  {
+    prop: 'record',
+    label: '标记',
+    span: 24,
+    _slot_: 'record'
+  }
+]
+
+export { showColumns }

+ 58 - 0
src/views/purchaseIn/returnGoodWorkOrder/components/mark-modal.vue

@@ -0,0 +1,58 @@
+<template>
+  <el-dialog :visible.sync="innerVisible" title="退货工单标记" center>
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px" :loading="loading" @click="() => onMark()">保存</el-button>
+    <div style="clear:both" />
+  </el-dialog>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+import asyncRequest from '@/apis/service/sellOut/returnGoodWorkOrder'
+export default {
+  components: { VueEditor },
+  props: ['sitem', 'visible'],
+  data: () => ({
+    content: '',
+    loading: false
+  }),
+  computed: {
+    innerVisible: {
+      get() {
+        return this.visible
+      },
+      set(newValue) {
+        this.$emit('update:visible', newValue)
+      }
+    }
+  },
+  watch: {
+    visible: {
+      handler() {
+        if (!this.visible) return null
+        this.$nextTick(() => {
+          this.content = this.sitem.record
+        })
+      }
+    }
+  },
+  methods: {
+    async onMark() {
+      this.loading = true
+      const { code, message } = await asyncRequest.setAfterChildRecord({ record: this.content, id: this.sitem.id })
+      this.loading = false
+
+      switch (code) {
+        case 0:
+          this.content = ''
+          this.innerVisible = false
+          this.$emit('reload')
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 185 - 0
src/views/purchaseIn/returnGoodWorkOrder/components/wait-stockman.vue

@@ -0,0 +1,185 @@
+<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="good_receive_type">
+          <el-select placeholder="货物情况" style="width:100%" v-model="ruleForm.good_receive_type">
+            <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="loss_num">
+          <digital-input
+            :values="ruleForm.loss_num"
+            :placeholder="'丢失数量'"
+            :min="0"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            @reschange="number_change($event, 'loss_num')"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            placeholder="请输入备注"
+            type="textarea"
+            maxlength="100"
+            :size="'mini'"
+            v-model="ruleForm.remark"
+            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_loss_num = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
+      } else {
+        callback();
+      }
+    };
+
+    return {
+      status: "",
+      ruleForm: {
+        good_receive_type: "0", //发货物流公司
+        remark: "", //物流单号
+        loss_num: "",
+      },
+      statusOptions:[
+        { value:'0', label:'库房未发货无需追回'},
+        { value:'1', label:'库房已发货无全部追回'},
+        { value:'2', label:'库房已发货已无法追回'},
+        { value:'3', label:'库房已发货已部分追回'},
+      ],
+      rules: {
+        good_receive_type: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择发货公司",
+            trigger: "change",
+          },
+        ],
+        loss_num: [
+          {
+            required: true,
+            validator: validate_loss_num,
+            trigger: "blur",
+          },
+        ],
+        remark: [
+          {
+            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.good_receive_type = model.good_receive_type.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.good_receive_type = e && e.code ? [e.label] : [];
+      this.$refs.ruleForm.validateField("good_receive_type");
+    },
+  },
+};
+</script>

+ 36 - 0
src/views/purchaseIn/returnGoodWorkOrder/components/work-order-mark.vue

@@ -0,0 +1,36 @@
+<template>
+  <div class="work-order-mark__wrapper">
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px" @click="() => onMark()">保存</el-button>
+  </div>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+import asyncRequest from '@/apis/service/sellOut/returnGoodWorkOrder'
+export default {
+  components: { VueEditor },
+  props: ['sitem'],
+  data: () => ({
+    content: '',
+    loading: false
+  }),
+  methods: {
+    async onMark() {
+      this.loading = true
+      const { code, message } = await asyncRequest.setAfterChildRecord({ record: this.content, id: this.sitem.id })
+      this.loading = false
+
+      switch (code) {
+        case 0:
+          this.content = ''
+          this.$emit('reload')
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 239 - 0
src/views/purchaseIn/returnGoodWorkOrder/detail.vue

@@ -0,0 +1,239 @@
+<template>
+  <div class="sellReturnDetail pagePadding">
+    <div style="display:flex;justify-content:flex-end;align-items:center">
+        <el-button type="primary" plain size="mini" @click="visible = true">退货工单标记</el-button>
+    </div>
+
+    <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) || {})
+                        .label || '--'
+                    "
+                  ></el-tag>
+                </template>
+
+                <template slot="stock_type">
+                  <el-tag size="mini">{{sitem.type === '1' ? '销售仓' : '次品仓'}}</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="record">
+                  <div  class="ql-editor"  v-html="sitem.record"></div>
+                </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>f=
+                    <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="360" 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="returnWsm">
+                  <span>{{ sitem.return_wsm_name }}</span>
+                  <el-popover placement="top" width="360" trigger="hover">
+                    <ul>
+                      <li><h3>退货仓库</h3></li>
+                      <li>
+                        <span>编号:</span
+                        ><span>{{ sitem.return_wsm_code }}</span>
+                      </li>
+                      <li>
+                        <span>名称:</span
+                        ><span>{{ sitem.return_wsm_name}}</span>
+                      </li>
+                      <li>
+                        <span>负责人:</span>
+                        <span>{{ sitem.return_contactor_name }}</span>
+                      </li>
+                      <li>
+                        <span>供应商编码:</span
+                        ><span>{{ sitem.return_supplierNo }}</span>
+                      </li>
+                      <li>
+                        <span>供应商名称:</span
+                        ><span>{{ sitem.return_supplierName }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference" />
+                  </el-popover>
+                </template>
+
+                <template slot="sendWsm">
+                  <span>{{ sitem.send_wsm_name }}</span>
+                  <el-popover placement="top" width="360" trigger="hover">
+                    <ul>
+                      <li><h3>发货仓库</h3></li>
+                      <li>
+                        <span>编号:</span
+                        ><span>{{ sitem.send_wsm_code }}</span>
+                      </li>
+                      <li>
+                        <span>名称:</span
+                        ><span>{{ sitem.send_wsm_name }}</span>
+                      </li>
+                      <li>
+                        <span>负责人:</span>
+                        <span>{{ sitem.return_contactor_name }}</span>
+                      </li>
+                      <li>
+                        <span>供应商编码:</span
+                        ><span>{{ sitem.send_supplierNo }}</span>
+                      </li>
+                      <li>
+                        <span>供应商名称:</span
+                        ><span>{{ sitem.send_supplierName }}</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="360" 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="2">
+              <show-goods-data-table :type="order_type" :spucode="spuCode" iscgd :newTime="newTime"  />
+           </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+
+    <mark-modal :visible.sync="visible" :sitem="sitem" @reload="() => initData()" />
+  </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 MarkModal from "./components/mark-modal.vue";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "deliveryWorkOrderDetail",
+  mixins: [mixinPage, resToken],
+  components: { MarkModal },
+  computed: {
+    ...mapGetters(['isSupertube']),
+    powers() {
+      const {btnList} = this.$store.getters;
+      const tran = btnList.find((item) => item.menu_route == "returnGoodWorkOrderDetail" ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      activeTabs: "1",
+      showColumns: showColumns,
+      visible:false,
+      statusOptions: [
+        { value: "1", label: "待主流程收货" },
+        { value: "2", label: "主流程已收货" }
+      ],
+      newTime: "",
+      spuCode:"",
+      order_type:"",
+      xs_order_type_options,
+      sitem: null, //传给组件
+      activeNames: ["0", "1", "2", "3", "4", "5", "6"],
+      status: "", //存储详情接口状态
+      statusList: [
+        { value: "1", label: "待收货" },
+        { value: "2", label: "已收货" }
+      ],
+      loading: false,
+      is_stock: "",
+      queryId: "",
+    };
+  },
+  mounted() {
+    this.queryId = this.$route.query.id;
+    this.initData();
+  },
+  methods: {
+    async initData() {
+      const { code, data, message } = await asyncRequest.detail({
+        id: this.queryId,
+      });
+
+      if (code === 0) {
+        const { is_stock, status ,spuCode,order_type } = data;
+        this.spuCode = spuCode
+        this.order_type = order_type
+        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>

+ 668 - 0
src/views/purchaseIn/returnGoodWorkOrder/index.vue

@@ -0,0 +1,668 @@
+<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="3" style="width: 120px">
+                <el-switch 
+                  v-model="parmValue.use_type"
+                  :active-value="usetypeOtions[1].value"
+                  :inactive-value="usetypeOtions[0].value"
+                  :active-text="usetypeOtions[1].label"
+                  :inactive-text="usetypeOtions[0].label"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                />
+              </el-col>
+              <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_source"
+                  filterable
+                  clearable
+                  placeholder="订单来源"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_source_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_type"
+                  filterable
+                  clearable
+                  placeholder="商品类型"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_type_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+
+              <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
+                <search-supplier
+                  :size="'mini'"
+                  style="width: 100%"
+                  :value="parmValue.supplierNo"
+                  :disabled="false"
+                  :placeholder="'供应商名称'"
+                  :names="parmValue.supplierName"
+                  :isDetail="true"
+                  :noDisabled="true"
+                  @searchChange="supplierChange"
+                />
+              </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-row>
+            <el-row style="padding: 10px 0 0 0">
+              <el-col :span="4" style="width: 200px">
+                <el-select
+                  style="width: 100%"
+                  placeholder="状态"
+                  size="mini"
+                  clearable
+                  v-model="parmValue.status"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option label="待收货" value="1" />
+                  <el-option label="已收货" value="2" />
+                </el-select>
+              </el-col>
+              <el-col :span="8" style="width: 502px; padding: 0 0 0 10px">
+                <el-input
+                  placeholder="关键字"
+                  size="mini"
+                  v-model="queryValue"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <template #prepend>
+                    <el-select
+                      style="width: 150px"
+                      v-model="queryKey"
+                      @change="
+                        pageInfo.curr = 1;
+                        parmValue.page = 1;
+                        searchList();
+                      "
+                    >
+                      <el-option value="returnCode" label="售后申请单编码" />
+                      <el-option value="orderCode" label="订单编码" />
+                      <el-option value="outChildCode" label="发货工单编码" />
+                      <!-- <el-option value="return_wsm_code" label="退货仓库编码" /> -->
+                    </el-select>
+                  </template>
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  ></el-button>
+                </el-input>
+              </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-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 #stcok_in="{scope}">{{
+            scope.row.type === "1" ? scope.row.can_sell_num : scope.row.defective_num
+        }}</template>
+
+        <template #returnWsm="{ scope }">
+          <el-popover placement="top" width="360" trigger="hover">
+            <i class="el-icon-warning-outline" slot="reference"></i>
+            <ul>
+              <li><h3>退货仓库</h3></li>
+              <li>
+                <span>编号:</span><span>{{ scope.row.return_wsm_code }}</span>
+              </li>
+              <li>
+                <span>名称:</span><span>{{ scope.row.return_wsm_name }}</span>
+              </li>
+              <li>
+                <span>负责人:</span><span>{{ scope.row.return_contactor_name }}</span>
+              </li>
+              <li>
+                <span>供应商编码:</span><span>{{ scope.row.return_supplierNo }}</span>
+              </li>
+              <li>
+                <span>供应商名称:</span><span>{{ scope.row.return_supplierName }}</span>
+              </li>
+            </ul>
+          </el-popover>
+          <span>{{ scope.row.return_wsm_name }}</span>
+        </template>
+
+        <template #order_type="{ scope }">
+          <el-tag size="mini">{{
+            (xs_order_type_options.find(({ id }) => id === scope.row.order_type) || {})
+              ?.label || "--"
+          }}</el-tag>
+        </template>
+
+        <template #use_type="{ scope }">
+          <el-tag size="mini">
+            {{
+              (usetypeOtions.find(({ value }) => value === scope.row.use_type) || {})
+                .label || "---"
+            }}
+          </el-tag>
+        </template>
+
+        <template #stock_type="{ scope }">
+          <el-tag :type="scope.row.type !== '1' ? 'warning' : ''" size="mini">{{
+            scope.row.type === "1" ? "销售仓" : "次品仓"
+          }}</el-tag>
+        </template>
+
+        <template #sendWsm="{ scope }">
+          <el-popover placement="top" width="360" trigger="hover">
+            <i class="el-icon-warning-outline" slot="reference"></i>
+            <ul>
+              <li><h3>退货仓库</h3></li>
+              <li>
+                <span>编号:</span><span>{{ scope.row.send_wsm_code }}</span>
+              </li>
+              <li>
+                <span>名称:</span><span>{{ scope.row.send_wsm_name }}</span>
+              </li>
+              <li>
+                <span>负责人:</span><span>{{ scope.row.send_contactor_name }}</span>
+              </li>
+              <li>
+                <span>供应商编码:</span><span>{{ scope.row.send_supplierNo }}</span>
+              </li>
+              <li>
+                <span>供应商名称:</span><span>{{ scope.row.send_supplierName }}</span>
+              </li>
+            </ul>
+          </el-popover>
+          <span>{{ scope.row.send_wsm_name }}</span>
+        </template>
+
+        <template #type="{ scope }">
+          <el-tag size="mini">{{
+            scope.row.type === "1" ? "未发货退货" : "售后申请"
+          }}</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('returnGoodWorkOrderDetail', scope.row.id)"
+            ></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 asyncRequest from "@/apis/service/sellOut/returnGoodWorkOrder";
+import {
+  xs_order_type_options,
+  xs_order_source_options,
+  usetypeOtions,
+} from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper";
+import urlConfig from "@/apis/url-config";
+import { mapGetters } from "vuex";
+import columns from "./columns";
+
+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 == "returnGoodWorkOrder"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      xs_order_type_options,
+      xs_order_source_options,
+      fileUrl: urlConfig.baseURL,
+      usetypeOtions,
+      select: "outChildCode", //默认选择下拉框
+      s_input: "", //搜索框内容
+      select_list: [],
+      supplierNo: [],
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { value: "1", label: "待主流程收货" },
+        { value: "2", label: "主流程已收货" },
+      ],
+      loading: false,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        supplierNo:"",
+        supplierName:"",
+        use_type: "1",
+        type: "",
+        order_type: "",
+        returnCode: "",
+        status: "",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        // order_type: "",
+      },
+      queryKey: "returnCode",
+      queryValue: "",
+      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.queryKey = this.parmValue.queryKey;
+      this.queryValue = this.parmValue.queryValue;
+      // 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.parmValue.supplierNo = code ? [code] : [];
+      this.parmValue.supplierName = label
+      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,
+            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.queryKey = this.queryKey;
+        // this.parmValue.sselect = this.sselect ;
+        this.parmValue.queryValue = this.queryValue;
+        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 = {
+        use_type: "1",
+        order_type: "1",
+        company_name: "", //申请人部门
+        good_code: "",
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      };
+
+      this.queryValue = "";
+
+      // 表格 - 分页
+      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));
+      console.log(model)
+      delete model["s_input"];
+      // delete model['supplierNo']
+
+      const res = await asyncRequest.list({
+        ...model,
+        is_authority: "1",
+        [this.select]: this.s_input,
+        [this.queryKey]: this.queryValue,
+        companyNo: this.currentCompany,
+        supplierNo: Array.isArray(model.supplierNo) ? model.supplierNo[0] : model.supplierNo,
+        customer_code: Array.isArray(this.parmValue.customer_code)
+          ? this.parmValue.customer_code[0]
+          : this.parmValue.customer_code,
+        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/purchaseIn/returnGoodWorkOrder/售后退货工单管理


+ 132 - 0
src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/columns.js

@@ -0,0 +1,132 @@
+export default [
+  // { type: 'selection', fixed: 'left', _noset_: true },
+  {
+    prop: 'saleReturnChildCode',
+    label: '售前退货工单编号',
+    width: '160'
+  },
+  {
+    prop: 'returnCode',
+    label: '售前退货单编号',
+    width: '160'
+  },
+  {
+    prop: 'orderCode',
+    label: '订单编号',
+    width: '160px'
+  },
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    width: '160px'
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    width: '80px'
+  },
+  {
+    prop: 'use_type',
+    label: '平台类型',
+    _slot_: 'use_type',
+    width: '80px'
+  },
+ 
+  // {
+  //   prop: 'type',
+  //   label: '仓库类型',
+  //   _slot_: 'stock_type',
+  //   width: '100px'
+  // },
+  {
+    prop: 'order_source',
+    label: '订单来源',
+    _slot_: 'order_source',
+    width: '100px'
+  },
+  {
+    prop: 'order_type',
+    label: '商品类型',
+    _slot_: 'order_type',
+    width: '100px'
+  },
+  {
+    prop: 'good_code',
+    label: '商品编码',
+    width: '160px'
+  },
+  {
+    prop: 'good_name',
+    label: '商品名称',
+    width: '160px'
+  },
+
+  {
+    prop: 'return_wsm_name',
+    label: '退回仓库名称',
+    width: '150px',
+    _slot_: 'returnWsm'
+  },
+  {
+    prop: 'return_contactor_name',
+    label: '退回仓库负责人',
+    width: '120px'
+  },
+  {
+    prop: 'companyNo',
+    label: '业务公司编号',
+    width: '150px'
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司名称',
+    width: '150px'
+  },
+  {
+    prop: 'supplierNo',
+    label: '供应商编码',
+    width: '150px'
+  },
+  {
+    prop: 'supplierName',
+    label: '供应商名称',
+    width: '150px'
+  },
+  {
+    prop: 'customer_code',
+    label: '客户编码',
+    width: '150px'
+  },
+  {
+    prop: 'customerName',
+    label: '客户名称',
+    width: '150px'
+  },
+  {
+    prop: 'apply_name',
+    label: '申请人',
+    span: 5
+  },
+  {
+    prop: 'addtime',
+    label: '创建时间',
+    width: '150px'
+  },
+  {
+    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	状态

+ 85 - 0
src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/components/ShowDataTableColumns.js

@@ -0,0 +1,85 @@
+const showColumns = [
+  {
+    prop: 'returnCode',
+    label: '售前退货工单号',
+    span: 8
+  },
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    span: 8
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    span: 4
+  },
+  {
+    prop: 'apply_name',
+    label: '创建人',
+    span: 4
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司',
+    _slot_: 'companyName',
+    span: 12
+  },
+  {
+    prop: 'customerName',
+    label: '客户公司',
+    _slot_: 'customerName',
+    span: 12
+  },
+  {
+    prop: 'supplierName',
+    label: '供应商',
+    _slot_: 'supplierName',
+    span: 12
+  },
+  {
+    prop: 'return_wsm_code',
+    label: '退货仓库',
+    _slot_: 'returnWsm',
+    span: 12
+  },
+  // {
+  //   prop: 'send_wsm_code',
+  //   label: '发货仓库编码',
+  //   span: 12
+  // },
+  {
+    prop: 'send_num',
+    label: '发货数量',
+    span: 5
+  },
+  {
+    prop: 'return_num',
+    label: '退货数量',
+    span: 5
+  },
+  {
+    prop: 'loss_num',
+    label: '丢失数量',
+    span: 5
+  },
+  {
+    prop: 'addtime',
+    label: '创建时间',
+    span: 9
+  },
+  {
+    prop: 'remark',
+    label: '备注',
+    span: 24
+  },
+  {
+    prop: 'record',
+    label: '标记',
+    span: 24,
+    _slot_: 'record'
+  }
+]
+
+export { showColumns }

+ 60 - 0
src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/components/mark-modal.vue

@@ -0,0 +1,60 @@
+<template>
+  <el-dialog :visible.sync="innerVisible" title="退货工单标记" center>
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px" :loading="loading" @click="() => onMark()">保存</el-button>
+    <div style="clear:both" />
+  </el-dialog>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+import asyncRequest from '@/apis/service/sellOut/beforeReturnGoodWorkOrder'
+export default {
+  components: { VueEditor },
+  props: ['sitem', 'visible'],
+  data: () => ({
+    content: '',
+    loading: false
+  }),
+  computed: {
+    innerVisible: {
+      get() {
+        return this.visible
+      },
+      set(newValue) {
+        this.$emit('update:visible', newValue)
+      }
+    }
+  },
+  watch: {
+    visible: {
+      handler() {
+        if (!this.visible) return null
+        this.$nextTick(() => {
+          console.log(this.sitem.record)
+          this.content = this.sitem.record
+        })
+      },
+      immediate: true
+    }
+  },
+  methods: {
+    async onMark() {
+      this.loading = true
+      const { code, message } = await asyncRequest.setAfterChildRecord({ record: this.content, id: this.sitem.id })
+      this.loading = false
+
+      switch (code) {
+        case 0:
+          this.content = ''
+          this.innerVisible = false
+          this.$emit('reload')
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 176 - 0
src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/components/wait-stockman.vue

@@ -0,0 +1,176 @@
+<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="good_receive_type">
+          <el-select placeholder="货物情况" style="width:100%" v-model="ruleForm.good_receive_type">
+            <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="loss_num">
+          <digital-input
+            :values="ruleForm.loss_num"
+            :placeholder="'丢失数量'"
+            :min="0"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            :disabled="disabledLossField"
+            @reschange="number_change($event, 'loss_num')"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            placeholder="请输入备注"
+            type="textarea"
+            maxlength="100"
+            :size="'mini'"
+            v-model="ruleForm.remark"
+            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/beforeReturnGoodWorkOrder";
+export default {
+  name: "allotFlow",
+  mixins: [resToken],
+  props: ["id", "sitem"],
+  computed: {
+    disabledLossField(){
+      const {good_receive_type} = this.ruleForm;
+      return ['0','1','2'].includes(good_receive_type)
+    },
+    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() {
+    return {
+      status: "",
+      ruleForm: {
+        good_receive_type: "0", //发货物流公司
+        remark: "", //物流单号
+        loss_num: "",
+      },
+      statusOptions:[
+        { value:'0', label:'库房未发货无需追回'},
+        { value:'1', label:'库房已发货已全部追回'},
+        { value:'2', label:'库房已发货已无法追回'},
+        { value:'3', label:'库房已发货已部分追回'}
+      ],
+      rules: {
+        good_receive_type: [
+          {
+            required: true,
+            message: "请选择货物情况",
+            trigger: "blur",
+          },
+        ],
+        loss_num: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请输入丢失数量",
+          },
+        ],
+        remark: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请输入备注"
+          },
+        ],
+      },
+    };
+  },
+  watch:{
+    'ruleForm.good_receive_type':{
+      handler(value){
+        if(value === '2'){
+        this.ruleForm.loss_num = this.sitem.return_num;
+      }else{
+        this.ruleForm.loss_num = "0"
+        }
+       },
+       immediate:true
+      }
+  },
+  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) => {
+        console.log(valid)
+        if (valid) {
+          if (this.loading) {
+            return;
+          }
+          this.loading = true;
+          const model = JSON.parse(JSON.stringify(this.ruleForm));
+          let res = await asyncRequest.reorderChildReceive({id:this.sitem.id,...model});
+          this.loading = false;
+
+          if (res && res.code === 0) {
+            this.showModelThis = false;
+            this.$emit("reload");
+          } 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.good_receive_type = e && e.code ? [e.label] : [];
+      this.$refs.ruleForm.validateField("good_receive_type");
+    },
+  },
+};
+</script>

+ 37 - 0
src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/components/work-order-mark.vue

@@ -0,0 +1,37 @@
+<template>
+  <div class="work-order-mark__wrapper">
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px" @click="() => onMark()">保存</el-button>
+  </div>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+import asyncRequest from '@/apis/service/sellOut/beforeReturnGoodWorkOrder'
+
+export default {
+  components: { VueEditor },
+  props: ['sitem'],
+  data: () => ({
+    content: '',
+    loading: false
+  }),
+  methods: {
+    async onMark() {
+      this.loading = true
+      const { code, message } = await asyncRequest.setAfterChildRecord({ record: this.content, id: this.sitem.id })
+      this.loading = false
+
+      switch (code) {
+        case 0:
+          this.content = ''
+          this.$emit('reload')
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 214 - 0
src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/detail.vue

@@ -0,0 +1,214 @@
+<template>
+  <div class="sellReturnDetail pagePadding">
+    <div style="display:flex;justify-content:flex-end;align-items:center">
+        <el-button type="primary" plain size="mini" @click="() => visible = true">退货工单标记</el-button>
+    </div>
+
+    <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) || {})
+                        .label || '--'
+                    "
+                  ></el-tag>
+                </template>
+
+                <template slot="record">
+                  <div class="ql-editor" v-html="sitem.record" />
+                </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="returnWsm">
+                  <span>{{ sitem.return_wsm_name }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li><h3>退货仓库</h3></li>
+                      <li>
+                        <span>编码:</span
+                        ><span>{{ sitem.return_wsm_code }}</span>
+                      </li>
+                      <li>
+                        <span>名称:</span
+                        ><span>{{ sitem.return_wsm_name }}</span>
+                      </li>
+                      <li>
+                        <span>负责人:</span
+                        ><span>{{ sitem.return_contactor_name }}</span>
+                      </li>
+                      <li>
+                        <span>供应商编码:</span
+                        ><span>{{ sitem.return_supplierNo }}</span>
+                      </li>
+                      <li>
+                        <span>供应商名称:</span
+                        ><span>{{ sitem.return_supplierName }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+
+                <template slot="customerName">
+                  <span>{{ sitem.customerName }}</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="2">
+              <show-goods-data-table :type="order_type" :spucode="spuCode" iscgd :newTime="newTime"  />
+            </el-collapse-item>
+
+            <el-collapse-item title="待库管收货" name="1" v-if="sitem && ppowers.includes('1') && String(sitem.status) === '1' && !isSupertube">
+              <wait-stockman :sitem="sitem" @reload="initData" />
+            </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+
+
+        <el-tab-pane label="审批记录" name="2">
+          <process-time-line
+            v-if="newTime !== ''"
+            :newTime="newTime"
+            :type="'THGD'"
+            :orderCode="sitem.returnCode"
+          />
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+    <mark-modal :visible.sync="visible" :sitem="sitem" @reload="() => initData()" />
+  </div>
+</template>
+
+<script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/beforeReturnGoodWorkOrder";
+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";
+
+import MarkModal from "./components/mark-modal.vue";
+export default {
+  name: "deliveryWorkOrderDetail",
+  mixins: [mixinPage, resToken],
+  components: { WaitStockman, WorkOrderMark , MarkModal},
+  computed: {
+    ...mapGetters(['isSupertube']),
+    powers() {
+      const {btnList} = this.$store.getters;
+      const tran = btnList.find((item) => item.menu_route == "supplierBeforeReturnGoodWorkOrderDetail" ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "THGD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    }
+  },
+  data() {
+    return {
+      visible: false,
+      activeTabs: "1",
+      showColumns: showColumns,
+      statusOptions: [
+        { value: "1", label: "待收货" },
+        { value: "2", label: "已收货" },
+      ],
+      order_type: "",
+      spuCode: "",
+      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.initData();
+  },
+  methods: {
+    async initData() {
+      const { code, data, message } = await asyncRequest.detail({
+        id: this.queryId,
+      });
+      if (code === 0) {
+        const { is_stock, status,order_type, spuCode } = data;
+        this.is_stock = is_stock;
+        this.order_type = order_type
+        this.spuCode = spuCode
+        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>

+ 623 - 0
src/views/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/index.vue

@@ -0,0 +1,623 @@
+<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="3" style="width: 120px">
+                <el-switch 
+                  v-model="parmValue.use_type"
+                  :active-value="usetypeOtions[1].value"
+                  :inactive-value="usetypeOtions[0].value"
+                  :active-text="usetypeOtions[1].label"
+                  :inactive-text="usetypeOtions[0].label"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                />
+              </el-col>
+              <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_source"
+                  filterable
+                  clearable
+                  placeholder="订单来源"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_source_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_type"
+                  filterable
+                  clearable
+                  placeholder="商品类型"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_type_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+
+              <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
+                <search-work-company
+                  :value="parmValue.companyNo"
+                  style="width: 100%"
+                  :placeholder="'业务公司'"
+                  :size="searchSize"
+                  @searchChange="companyNosearchChange"
+                />
+              </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-row>
+            <el-row style="padding: 10px 0 0 0">
+              <el-col :span="4" style="width: 200px">
+                <el-select
+                  style="width: 100%"
+                  placeholder="状态"
+                  size="mini"
+                  clearable
+                  v-model="parmValue.status"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option label="待收货" value="1" />
+                  <el-option label="已收货" value="2" />
+                </el-select>
+              </el-col>
+              <el-col :span="8" style="width: 502px; padding: 0 0 0 10px">
+                <el-input
+                  placeholder="关键字"
+                  size="mini"
+                  v-model="parmValue.queryValue"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <template #prepend>
+                    <el-select
+                      style="width: 150px"
+                      v-model="parmValue.queryKey"
+                      @change="
+                        pageInfo.curr = 1;
+                        parmValue.page = 1;
+                        searchList();
+                      "
+                    >
+                      <el-option value="saleReturnChildCode" label="售前退货工单编码" />
+                      <el-option value="returnCode" label="售前退货单编码" />
+                      <el-option value="orderCode" label="订单编码" />
+                      <el-option value="outChildCode" label="发货工单编码" />
+                      <el-option value="return_wsm_code" label="退货仓库编码" />
+                    </el-select>
+                  </template>
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  ></el-button>
+                </el-input>
+              </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-row>
+          </div>
+        </template>
+        <template #status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '1' ? 'warning' : ''"
+            v-text="
+              (statusOptions.find((item) => item.value == scope.row.status) || {})
+                .label || '--'
+            "
+          ></el-tag>
+        </template>
+
+        <template #use_type="{ scope }">
+          <el-tag size="mini">
+            {{
+              (usetypeOtions.find(({ value }) => value === scope.row.use_type) || {})
+                .label || "---"
+            }}
+          </el-tag>
+        </template>
+
+        <template #returnWsm="{ scope }">
+          <el-popover placement="top" width="360" trigger="hover">
+            <i class="el-icon-warning-outline" slot="reference"></i>
+            <ul>
+              <li><h3>退货仓库</h3></li>
+              <li>
+                <span>编号:</span><span>{{ scope.row.return_wsm_code }}</span>
+              </li>
+              <li>
+                <span>名称:</span><span>{{ scope.row.return_wsm_name }}</span>
+              </li>
+              <li>
+                <span>负责人:</span><span>{{ scope.row.return_contactor_name }}</span>
+              </li>
+              <li>
+                <span>供应商编码:</span><span>{{ scope.row.return_supplierNo }}</span>
+              </li>
+              <li>
+                <span>供应商名称:</span><span>{{ scope.row.return_supplierName }}</span>
+              </li>
+            </ul>
+          </el-popover>
+          <span>{{ scope.row.return_wsm_name }}</span>
+        </template>
+
+        <template #type="{ scope }">
+          <el-tag size="mini">{{
+            scope.row.type === "1" ? "未发货退货" : "售后申请"
+          }}</el-tag>
+        </template>
+
+        <template #stock_type="{ scope }">
+          <el-tag :type="String(scope.row.type) !== '1' ? 'warning' : ''" size="mini">{{
+            scope.row.type === "1" ? "销售仓" : "次品仓"
+          }}</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('supplierBeforeReturnGoodWorkOrderDetail', scope.row.id)"
+            ></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 asyncRequest from "@/apis/service/sellOut/beforeReturnGoodWorkOrder";
+import {
+  xs_order_type_options,
+  xs_order_source_options,
+  usetypeOtions,
+} from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper";
+import urlConfig from "@/apis/url-config";
+import { mapGetters } from "vuex";
+import columns from "./columns";
+
+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 == "supplierBeforeReturnGoodWorkOrder"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      companyNo: "",
+      usetypeOtions,
+      xs_order_type_options,
+      xs_order_source_options,
+      fileUrl: urlConfig.baseURL,
+      select: "outChildCode", //默认选择下拉框
+      s_input: "", //搜索框内容
+      select_list: [],
+      supplierNo: [],
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { value: "1", label: "待收货" },
+        { value: "2", label: "已收货" },
+      ],
+      // queryKey: "saleReturnChildCode",
+      queryValue: "",
+      loading: false,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        queryKey:'returnCode',
+        queryValue:"",
+        order_type: "",
+        saleReturnChildCode: "",
+        status: "",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        use_type: "1",
+        // 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 companyNosearchChange(e) {
+      const { code } = e;
+      this.parmValue.companyNo = 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,
+              noRelation: 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 = {
+        queryKey:'returnCode',
+        order_type: "",
+        company_name: "", //申请人部门
+        good_code: "",
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        use_type: "1",
+      };
+
+      // 表格 - 分页
+      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,
+        [this.parmValue.queryKey]: this.parmValue.queryValue,
+        customer_code: Array.isArray(this.parmValue.customer_code)
+          ? this.parmValue.customer_code[0]
+          : this.parmValue.customer_code,
+        supplierNo: 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/supplierPurchaseIn/supplierBeforeReturnGoodWorkOrder/退货工单管理


+ 287 - 0
src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/columns.js

@@ -0,0 +1,287 @@
+export default [
+
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    width: '160'
+  },
+  {
+    prop: 'outCode',
+    label: '发货单编号',
+    width: '160'
+  },
+  {
+    prop: 'orderCode',
+    label: '销售订单编号',
+    width: '160'
+  },
+  {
+    prop: 'cgdNo',
+    label: '采购单编号',
+    width: '160'
+  },
+  {
+    prop: 'good_name',
+    label: '产品名称',
+    width: '160'
+  },
+  {
+    prop: 'has_account',
+    label: '供应商端',
+    width: '80',
+    _slot_: 'has_account'
+  },
+  {
+    prop: 'use_type',
+    label: '平台类型',
+    _slot_: 'use_type',
+    width: '70'
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    width: '85px'
+  },
+  {
+    prop: 'order_type',
+    label: '商品类型',
+    _slot_: 'order_type',
+    width: '100'
+  },
+  {
+    prop: 'order_source',
+    label: '订单来源',
+    _slot_: 'order_source',
+    width: '100'
+  },
+  {
+    prop: 'num',
+    label: '总数量',
+    width: '100'
+  },
+  {
+    prop: 'wsm_code',
+    label: '仓库编号',
+    width: '155'
+  },
+  {
+    prop: 'wsm_name',
+    label: '仓库名称',
+    width: '160'
+  },
+  {
+    prop: 'sendtime',
+    label: '发货时间',
+    width: '160'
+  },
+  {
+    prop: 'spuCode',
+    label: '商品成本编码',
+    width: '160'
+  },
+  {
+    prop: 'skuCode',
+    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: 'send_status',
+  //   label: '分单状态',
+  //   _slot_: 'send_status',
+  //   width: '120px'
+  // },
+  {
+    prop: 'apply_name',
+    label: '申请人',
+    width: '80'
+  },
+  {
+    prop: 'addtime',
+    label: '下单时间',
+    width: 150
+  },
+
+  {
+    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	状态
+export const sendOutOrderColumns = [
+  {
+    type: 'index',
+    label: '序号',
+    width: '70px'
+  },
+  {
+    prop: 'value0',
+    label: '发货工单号',
+    'min-width': '156px'
+  },
+  {
+    prop: 'value1',
+    label: '发货单编号',
+    'min-width': '156px'
+  },
+  {
+    prop: 'value2',
+    label: '销售订单编号',
+    'min-width': '156px'
+  },
+  // {
+  //   prop: 'value3',
+  //   label: '订单编号',
+  //   'min-width': '156px'
+  // },
+  // {
+  //   prop: 'value11',
+  //   label: '',
+  //   'min-width': '180px'
+  // },
+  {
+    prop: 'value7',
+    label: '总数量',
+    'min-width': '100px'
+  },
+  // {
+  //   prop: 'value8',
+  //   label: '仓库编号',
+  //   'min-width': '100px'
+  // },
+  // {
+  //   prop: 'value9',
+  //   label: '仓库名称',
+  //   'min-width': '100px'
+  // },
+  // {
+  //   prop: 'value10',
+  //   label: '商品成本编码',
+  //   'min-width': '100px'
+  // },
+  // {
+  //   prop: 'value11',
+  //   label: '商品上线编码',
+  //   'min-width': '100px'
+  // },
+  // {
+  //   prop: 'value12',
+  //   label: '商品名称',
+  //   'min-width': '100px'
+  // },
+  {
+    prop: 'value22',
+    label: '物流公司',
+    'min-width': '150px'
+  },
+  {
+    prop: 'value23',
+    label: '物流单号',
+    'min-width': '150px'
+  },
+  {
+    prop: 'value24',
+    label: '物流费用',
+    'min-width': '140px'
+  }
+  // {
+  //   prop: 'value25',
+  //   label: '收货地址',
+  //   'min-width': '140px'
+  // },
+  // {
+  //   prop: 'value26',
+  //   label: '收货人',
+  //   'min-width': '140px'
+  // },
+  // {
+  //   prop: 'value27',
+  //   label: '收货联系人',
+  //   'min-width': '140px'
+  // },
+  // {
+  //   prop: 'value28',
+  //   label: '联系方式',
+  //   'min-width': '140px'
+  // },
+  // {
+  //   prop: 'value29',
+  //   label: '采购单号',
+  //   'min-width': '140px'
+  // }
+]
+export const head = [
+  '发货工单号',
+  '发货单编号	',
+  '销售订单编号	',
+  '供应商端	',
+  '状态	',
+  '商品类型	',
+  '订单来源	',
+  '总数量	',
+  '仓库编号	',
+  '仓库名称	',
+  '商品成本编码	',
+  '商品上线编码	',
+  '商品名称	',
+  '业务公司编号	',
+  '业务公司名称	',
+  '客户编号	',
+  '客户名称	',
+  '供应商编号	',
+  '供应商名称	',
+  '下单时间	',
+  '申请人	',
+  '对接类型	',
+  '物流公司	',
+  '物流单号	',
+  '物流费用',
+  '收货地址',
+  '收货联系人',
+  '联系方式',
+  '采购单号',
+  '备注'
+]
+
+console.log(head.length)

+ 81 - 0
src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/components/ShowDataTableColumns.js

@@ -0,0 +1,81 @@
+
+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: 'wsm_code',
+    label: '仓库名称',
+    _slot_: 'wsm_code',
+    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: 12
+  },
+  {
+    prop: 'post_fee',
+    label: '物流费用',
+    span: 12
+  }
+]
+
+export { showColumns }

+ 281 - 0
src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/components/express.vue

@@ -0,0 +1,281 @@
+<template>
+  <el-form
+    ref="ruleForm"
+    v-loading="loading"
+    :model="ruleForm"
+    :rules="rules"
+    :size="'mini'"
+    status-icon
+    label-width="95px"
+    class="demo-ruleForm"
+  >
+    <el-row>
+      <el-col :span="18">
+        <el-form-item label="物流费用" prop="post_fee">
+          <digital-input
+            :values="ruleForm.post_fee"
+            :placeholder="'物流费用'"
+            :min="0"
+            :disabled="type === 'view' || type === 'post_fee'"
+            :max="100000000000"
+            :position="'right'"
+            :precision="2"
+            :size="'mini'"
+            :controls="false"
+            :append="'元'"
+            @reschange="number_change($event, 'post_fee')"
+          />
+        </el-form-item>
+        <el-form-item label="物流公司" prop="post_name">
+          <search-express
+            :value="ruleForm.post_name"
+            :placeholder="'物流公司'"
+            :names="''"
+            :size="'mini'"
+            :order_source="order_source"
+            :is-detail="false"
+            @searchChange="handleCompany"
+          /> </el-form-item>
+        <el-col
+          v-for="(domain, index) in ruleForm.post_code"
+          :key="domain.key"
+          :span="12"
+        >
+          <el-form-item
+            :key="domain.key"
+            :label="'物流单号' + (index + 1)"
+            :prop="'post_code.' + index + '.value'"
+            :rules="const_post"
+          >
+            <el-input
+              v-model="domain.value"
+              placeholder="物流单号"
+              minlength="9"
+              maxlength="20"
+            >
+              <el-button
+                slot="append"
+                icon="el-icon-delete"
+                @click.prevent="removeDomain(index)"
+              />
+            </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24" style="text-align: right; padding: 0 0 16px 0">
+          <el-button
+            type="warning"
+            :size="'mini'"
+            icon="el-icon-circle-plus-outline"
+            @click="addDomain"
+          >添加快递单号</el-button>
+          <el-button
+            type="primary"
+            :size="'mini'"
+            icon="el-icon-search"
+            @click="submitForm"
+          >保 存
+          </el-button>
+        </el-col>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+import asyncRequest from '@/apis/service/sellOut/deliveryWorkOrder'
+import resToken from '@/mixins/resToken'
+import { isnumber, isNumeric } from '@/utils/validate'
+export default {
+  name: 'WsmInOrderAdd',
+  mixins: [resToken],
+  props: ['id', 'sitem', 'newTime'],
+  data() {
+    const validate_num = (rule, value, callback) => {
+      const { required } = rule
+      if (required && value === '') {
+        callback(new Error('不能为空!'))
+      } else {
+        callback()
+      }
+    }
+    const validateCode = (rule, value, callback) => {
+      const { required } = rule
+      const l = value.length
+      if (required) {
+        if (value === '') {
+          callback(new Error('物流单号不能为空!'))
+        } else if (l < 9 || l > 20) {
+          callback(new Error('仅支持纯数字或字母数字组合(9~20位)!'))
+        } else if (isnumber(value)) {
+          callback()
+        } else if (!isNumeric(value)) {
+          console.log(!isNumeric(value))
+          callback(new Error('仅支持纯数字或字母数字组合(9~20位)!'))
+        } else {
+          callback()
+        }
+      } else {
+        callback()
+      }
+    }
+
+    return {
+      loading: true,
+      order_source: '',
+      const_post: {
+        required: true,
+        validator: validateCode,
+        trigger: 'blur'
+      },
+      ruleForm: {
+        post_name: [],
+        post_code: [
+          {
+            value: '',
+            key: Date.now()
+          }
+        ],
+        post_fee: ''
+      },
+      rules: {
+        post_name: {
+          type: 'array',
+          required: true,
+          trigger: 'change',
+          message: '请输入物流公司'
+        },
+        post_code: {
+          required: true,
+          validator: validateCode,
+          trigger: 'blur'
+        },
+        post_fee: {
+          required: true,
+          validator: validate_num,
+          trigger: 'blur'
+        }
+      }
+    }
+  },
+  watch: {
+    newTime: function(val) {
+      if (val) {
+        this.initForm()
+      }
+    }
+  },
+  mounted() {
+    this.initForm()
+  },
+  methods: {
+    async initForm() {
+      this.loading = true
+      await this.resetForm()
+      this.loading = false
+    },
+    removeDomain(index) {
+      if (this.ruleForm.post_code.length === 1) {
+        this.$message.warning('至少填写一个快递单号!')
+        return
+      }
+      if (index !== -1) {
+        this.ruleForm.post_code.splice(index, 1)
+      }
+    },
+    addDomain() {
+      if (this.ruleForm.post_code.length >= 10) {
+        this.$message.warning('最多只能添加10条物流单号!')
+        return
+      }
+
+      this.ruleForm.post_code.push({
+        value: '',
+        key: Date.now()
+      })
+    },
+    // 初始化表单
+    async resetForm() {
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields()
+          this.$refs.ruleForm.clearValidate()
+
+          const {
+            post_code,
+            post_name,
+            post_fee,
+            remark,
+            order_source
+          } = this.sitem
+          this.order_source = order_source
+          this.ruleForm = {
+            post_name: post_name ? [post_name] : [],
+            post_code: [
+              {
+                value: post_code || '',
+                key: Date.now()
+              }
+            ],
+            post_fee: post_fee || '',
+            remark: remark || ''
+            // sendtime: "",
+          }
+        }
+      })
+    },
+    // 保存更改
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async(valid) => {
+        if (valid) {
+          if (this.loading) {
+            return
+          }
+          this.loading = true
+          const { post_code, post_name, post_fee } = this.ruleForm
+          const { outChildCode } = this.sitem
+
+          const model = {
+            list: [{
+              post_fee,
+              outChildCode,
+              post_name: Array.isArray(post_name) ? post_name[0] : post_name,
+              post_code: post_code.map(({ value }) => value).join(',')
+            }]
+          }
+
+          const { code, message } = await asyncRequest.express(model)
+          this.loading = false
+          if (code === 0) {
+            this.$notify.success({
+              title: '添加成功',
+              message: ''
+            })
+            this.$emit('refresh')
+          } else if (code >= 100 && code <= 104) {
+            await this.logout()
+          } else {
+            this.$message.warning(message)
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    handleCompany(e) {
+      const { code, id, label } = e
+      this.ruleForm.post_name = label ? [label] : []
+      this.$refs.ruleForm.validateField('post_name')
+    },
+    number_change(e, key) {
+      this.ruleForm[key] = e + '' || '0'
+      this.$refs.ruleForm.validateField(key)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.account {
+}
+</style>

+ 230 - 0
src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/detail.vue

@@ -0,0 +1,230 @@
+<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) || {})
+                        .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="wsm_code">
+                  <span>{{ sitem.wsm_name }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>仓库编号:</span
+                        ><span>{{ sitem.wsm_code }}</span>
+                      </li>
+                      <li>
+                        <span>仓库负责人:</span
+                        ><span>{{ sitem.contactor_name }}</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="2">
+              <show-goods-data-table
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :type="sitem.order_type"
+                :skucode="sitem.skuCode"
+                :spucode="sitem.good_code"
+              />
+            </el-collapse-item>
+
+            <el-collapse-item title="待库管发货" name="3"  v-if="canSend && sitem.status === '1' && !isSupertube && ppowers.includes('1')">
+              <express-node @refresh="() => initData()" :sitem="sitem" />
+            </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+
+        <el-tab-pane label="审批记录" name="2">
+          <process-time-line
+            v-if="newTime !== ''"
+            :newTime="newTime"
+            :type="'FHGD'"
+            :orderCode="queryId"
+          />
+        </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/deliveryWorkOrder";
+import { showColumns } from "./components/ShowDataTableColumns";
+import { xs_order_type_options } from "@/assets/js/statusList";
+import ExpressNode from "./components/express.vue"
+import { mapGetters } from "vuex";
+export default {
+  name: "deliveryWorkOrderDetail",
+  mixins: [mixinPage, resToken],
+  components: { ExpressNode },
+  computed: {
+    ...mapGetters(['isSupertube',"userInfo"]),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "supplierDeliveryWorkOrderDetail"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    canSend(){
+      const { id:userId } = this.userInfo || {};
+      const { contactor:manangerUserId ,order_type ,has_account } = this.sitem || {};
+      const isStock = String(order_type) === '1'
+
+      /* 不是库存品&&有供应商端账号 **/
+      if(!isStock && String(has_account) === '1'){
+        return true
+      }
+
+      /* 库存品&&用户id和库管id一致 **/
+      if(!userId || !manangerUserId) return false
+      return userId === manangerUserId
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "FHGD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    }
+  },
+  data() {
+    return {
+      activeTabs: "1",
+      showColumns: showColumns,
+      statusOptions: [
+      { value: "1", label: "待发货" },
+      { value: "2", label: "发货完成" },
+        // { value: "3", label: "已收货" },
+        // { value: "4", label: "已全部收货" },
+      { value: "5", 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.initData();
+  },
+  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>

+ 690 - 0
src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/index.vue

@@ -0,0 +1,690 @@
+<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="4" style="width: 120px">
+                <el-switch 
+                  v-model="parmValue.use_type"
+                  :active-value="usetypeOtions[1].value"
+                  :inactive-value="usetypeOtions[0].value"
+                  :active-text="usetypeOtions[1].label"
+                  :inactive-text="usetypeOtions[0].label"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                />
+              </el-col>
+              <!-- 时间区间 -->
+              <el-col :span="6" style="width: 303px; padding: 0 0 0 10px">
+                <period-date-picker
+                  :type="1"
+                  :width="'135px'"
+                  :size="searchSize"
+                  :start="parmValue.start"
+                  :end="parmValue.end"
+                  @timeReturned="handleTime"
+                />
+              </el-col>
+              <el-col :span="3" style="width: 240px; padding: 0 0 0 10px">
+                <search-customer
+                  :value="parmValue.customer_code"
+                  :size="'mini'"
+                  style="width: 100%"
+                  :names="parmValue.customer_name"
+                  :placeholder="'企业客户'"
+                  :disabled="false"
+                  :is-detail="true"
+                  @searchChange="customer_code_change"
+                />
+              </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-row>
+
+            <el-row style="margin-top: 10px">
+              <el-col :span="3" style="width: 200px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.status"
+                  filterable
+                  clearable
+                  placeholder="状态"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in statusOptions"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 151px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_source"
+                  filterable
+                  clearable
+                  placeholder="订单来源"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_source_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 151px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_type"
+                  filterable
+
+                  placeholder="商品类型"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_type_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+
+              <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
+                <search-work-company
+                  :value="parmValue.companyNo"
+                  :placeholder="'业务公司'"
+                  :disabled="false"
+                  style="width: 100%"
+                  :size="'mini'"
+                  :is-detail="true"
+                  @searchChange="company_idsearchChange"
+                />
+              </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-row>
+
+            <el-row style="padding: 10px 0 0 0">
+              <!-- <el-col :span="3">
+                <el-select size="mini" style="width:95%;" placeholder=""  v-model="parmValue.IsByMe" @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    ">
+                  <el-option label="所有数据" value="0" />
+                  <el-option label="由我执行" value="1" />
+                </el-select>
+              </el-col> -->
+
+              <el-col :span="6" style="width: 502px">
+                <el-input
+                  clearable
+                  placeholder="关键字"
+                  v-model="s_input"
+                  maxlength="40"
+                  :size="searchSize"
+                  class="input-with-select"
+                >
+                  <el-select
+                    v-model="select"
+                    style="width: 150px"
+                    slot="prepend"
+                    placeholder="关键字类型"
+                  >
+                    <el-option label="销售订单编号" value="orderCode" />
+                    <el-option label="采购单编号" value="cgdNo" />
+                    <el-option label="发货工单编号" value="outChildCode" />
+                    <el-option label="商品成本编号" value="spuCode" />
+                    <el-option label="发货单编号" value="outCode" />
+                    <el-option label="商品上线编号" value="skuCode" />
+                    <el-option label="申请人" value="apply_name" />
+                  </el-select>
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  ></el-button>
+                </el-input>
+              </el-col>
+
+              <el-col :span="5">
+                <el-select size="mini" style="width:104%;margin-left: 10px;" placeholder=""  v-model="parmValue.IsByMe" @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    ">
+                  <el-option label="与我相关" value="0" />
+                  <el-option label="由我执行" value="1" />
+                </el-select>
+              </el-col>
+              
+              <div style="margin-left: 10px; float: right">
+                <el-button
+                  v-if="powers.includes('090') && !isSupertube"
+                  type="primary"
+                  size="mini"
+                  @click="routeGoto('supplierDeliveryWorkOrderSend')"
+                  >批量发货</el-button
+                >
+              </div>
+
+              <div style="float: right" v-if="powers.includes('087') && !isSupertube">
+                <el-button type="primary" size="mini" @click="handleExport"
+                  >发货工单导出</el-button
+                >
+              </div>
+            </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 #has_account="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="
+              (
+                has_account_list.find(
+                  (item) => item.code == scope.row.has_account + ''
+                ) || {}
+              ).type || '--'
+            "
+            v-text="
+              (
+                has_account_list.find(
+                  (item) => item.code == scope.row.has_account + ''
+                ) || {}
+              ).name || '--'
+            "
+          ></el-tag>
+        </template>
+
+        <template #use_type="{ scope }">
+          <el-tag size="mini">
+            {{
+              (usetypeOtions.find(({ value }) => value === scope.row.use_type) || {})
+                .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('supplierDeliveryWorkOrderDetail', 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/deliveryWorkOrder";
+import { mapGetters } from "vuex";
+import urlConfig from "@/apis/url-config";
+import {
+  xs_order_type_options,
+  xs_order_source_options,
+  usetypeOtions,
+  has_account_list
+} 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 == "supplierDeliveryWorkOrder"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    dpowers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "supplierDeliveryWorkOrderDetail"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      has_account_list,
+      usetypeOtions,
+      xs_order_type_options,
+      xs_order_source_options,
+      fileUrl: urlConfig.baseURL,
+      select: "outChildCode", //默认选择下拉框
+      s_input: "", //搜索框内容
+      select_list: [],
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { value: "1", label: "待发货" },
+        { value: "2", label: "发货完成" },
+        { value: "5", label: "已取消" },
+      ],
+      loading: false,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        IsByMe:"1",
+        status: "",
+        companyNo: "",
+        customer_code: [],
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        company_name: "",
+        good_code: "",
+        skuCode: "",
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        order_type: "",
+        use_type: "1",
+      },
+      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.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];
+        this.parmValue.customer_name = e.label
+      } else {
+        this.parmValue.customer_code = [];
+        this.parmValue.customer_name = ""
+      }
+      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"];
+        delete model['customer_name']
+        delete model['select']
+
+        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: this.currentCompany,
+            noRelation: true,
+            // 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 = {
+        IsByMe:"1",
+        order_type: "",
+        company_name: "", //申请人部门
+        good_code: "",
+        returnCode: "", //销售退货code
+        orderCode: "", //销售订单code
+        apply_name: "", //申请人
+        start: "",
+        end: "",
+        status: "", //节点状态
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        use_type: "1",
+      };
+
+      // 表格 - 分页
+      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"];
+      delete model['customer_name']
+      delete model['select']
+
+      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: 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>

+ 308 - 0
src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/sendOutOrder.vue

@@ -0,0 +1,308 @@
+<template>
+  <div class="orderImport pagePadding" v-loading="loading">
+    <div v-if="tableData && tableData.length > 0" class="tr" style="padding: 10px 0 0 0">
+      <el-button @click="cancel" :size="'mini'">取消</el-button>
+      <el-button type="primary" @click="submit" :size="'mini'">提交</el-button>
+    </div>
+    <div v-else>
+      <upload-excel :on-success="handleSuccess" :before-upload="beforeUpload" />
+    </div>
+    <div>
+      <el-alert title="多物流单号请用逗号','隔开" type="warning" :closable="false">
+      </el-alert>
+    </div>
+    <ex-table
+      :columns="columns"
+      :table="table"
+      :data="tableData"
+      style="margin: 15px 0 0 0"
+    >
+    </ex-table>
+  </div>
+</template>
+
+<script>
+import asyncRequest from "@/apis/service/sellOut/deliveryWorkOrder";
+import { sendOutOrderColumns, head } from "./columns";
+import { isnumber, isNumeric } from "@/utils/validate";
+import resToken from "@/mixins/resToken";
+export default {
+  mixins: [resToken],
+  name: "orderImport",
+  data() {
+    return {
+      code_msg: "物流单号必传,且支持纯数字或字母数字组合(9~20位)!",
+      ruleForm: {
+        order_addr: [], //收货地址
+      },
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        "max-height": "800px",
+        // _defaultHeader_: ["setcol"],
+      },
+      tableData: [],
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      head,
+      loading: false,
+      // 表格 - 列参数
+      columns: sendOutOrderColumns,
+
+      //按钮锁
+      btnFlag: false,
+
+      //编辑全局锁
+      editBtnFlag: false,
+    };
+  },
+  methods: {
+    beforeUpload(file) {
+      const isLt1M = file.size / 1024 < 500;
+      if (isLt1M) {
+        return true;
+      }
+      this.$message({
+        message: "请不要上传大于500KB的文件.",
+        type: "warning",
+      });
+      return false;
+    },
+    handleSuccess({ results, header }) {
+      // alert(this.head.length, header.length)
+      // console.log(results)
+      if (!this.loading) {
+        this.loading = true;
+        if (results.length === 0) {
+          this.$message.error("表格无有效数据!");
+          this.loading = false;
+          return;
+        }
+
+        console.log(this.head.length,header.length);
+        if (this.head.length !== header.length) {
+          this.$message.error("表头与导入模板不匹配!");
+          this.loading = false;
+          return;
+        }
+        let hederOk = true;
+        this.head.forEach((v1, i1) => {
+          if (v1.replace(/\s*/g, "") !== header[i1].replace(/\s*/g, "")) {
+            hederOk = false;
+          }
+        });
+
+        if (!hederOk) {
+          this.$message.error("表头与导入模板不匹配!");
+          this.loading = false;
+          return;
+        }
+        this.tableData = [];
+        let list = results;
+
+        try {
+          list.forEach((obj, index) => {
+            let model = {};
+            let arr = Object.values(obj);
+            arr.forEach((key, ii) => {
+              let key_n = (key ?? "") + "";
+              key_n = key_n.replace(/\s+/g, "");
+              const s = /\\|\/|\?|\?|\*|\"|\“|\”|\'|\‘|\’|\,|\;|\?|\<|\>|\{|\}|\[|\]|\[|\]|\:|\:|\.|\^|\$|\!|\~|\`|\|/g;
+
+              Object.defineProperty(model, `value${ii}`, {
+                value: ii === 28 ? key_n.replace(s, ",") : key_n,
+              });
+            });
+            this.tableData.push(model);
+            // console.log(this.tableData);
+          });
+        } catch (e) {
+          console.log(e);
+        }
+        this.loading = false;
+      }
+    },
+    //取消
+    cancel() {
+      this.tableData = [];
+    },
+    validateCode(str) {
+      let arr = str.split(",");
+      let isok = true;
+      arr.forEach((value) => {
+        const l = value.length;
+        let res = true;
+        // else if (value === "0") {//之前支持0
+        //   res = true;
+        // }
+        if (value === "") {
+          res = false;
+        } else if (l >= 9 && l <= 20) {
+          if (isnumber(value)) {
+            res = true;
+          } else if (!isNumeric(value)) {
+            res = false;
+          } else {
+            res = true;
+          }
+        } else {
+          isok = false;
+        }
+        if (!res) {
+          isok = false;
+        }
+      });
+      return isok;
+    },
+
+    //提交
+    async submit() {
+      if (!this.loading) {
+        this.loading = true;
+        if (this.tableData.length === 0) {
+          this.$message.warning("导入数据不能为空");
+          this.loading = false;
+          return;
+        }
+
+        // if(this.tableData.length > 100){
+        //   this.$message.warning("导入数据最多不能超过100条");        
+        //   this.loading = false
+        // }
+
+        let isok = true,
+          list = [],
+          is_codeok = true;
+
+        this.tableData.forEach((key, index) => {
+          if (
+            key["value0"] === "" ||
+            key["value22"] === "" ||
+            key["value23"] === "" ||
+            key["value24"] === ""
+
+            // key['value25'] === "" ||
+            // key['value26'] === "" ||
+            // key['valye27'] === "" ||
+            // key['value28'] === "" ||
+            // key['value29'] === ""
+          ) {
+            isok = false;
+          }
+
+          let ketitem = {
+            outChildCode: key["value0"],
+            post_name: key["value22"],
+            post_code: key["value23"],
+            post_fee: key["value24"],
+          };
+
+          if (!this.validateCode(key["value23"])) {
+            is_codeok = false;
+          }
+          list.push(ketitem);
+        });
+
+        if (!isok) {
+          this.$notify.warning({
+            title: "以下字段不能为空!",
+            message:
+              "发货工单号/发货工单物流公司/发货工单物流单号/发货工单物流费用"
+          });
+          this.loading = false;
+          return;
+        }
+        if (!is_codeok) {
+          this.$notify.warning({
+            title: "部分物流单号不符合规则!",
+            message: this.code_msg,
+          });
+          this.loading = false;
+          return;
+        }
+        let model = {
+          list: JSON.parse(JSON.stringify(list)),
+        };
+      
+        
+        const { code, data, message } = await asyncRequest.express(model);
+        this.loading = false;
+        if (code === 0) {
+          this.$notify.success({
+            title: "导入成功!",
+            message: "",
+          });
+          this.tableData = [];
+          // await this.routeReGoto("sellOutOrder", {});
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else if (code == 1003) {
+          this.showal(data, message, "");
+        } else if (code == 1005) {
+          this.showal(data, message, "outCode");
+        } else if (code == 1011) {
+          this.showal(data, message, "outCode");
+        } else {
+          this.$message.warning(message);
+        }
+      }
+    },
+    showal(list, message, code) {
+      let htmlList = "<ul>";
+      list.forEach((v) => {
+        htmlList += `<li>${code !== "" ? v[code] : v}</li>`;
+      });
+      htmlList += "</ul>";
+      this.$notify({
+        title: message,
+        dangerouslyUseHTMLString: true,
+        message: htmlList,
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.box {
+  width: 100%;
+  // padding-top: 50px;
+  box-sizing: border-box;
+  // height: 100vh;
+  // overflow: hidden;
+  background: #fff;
+}
+.con {
+  width: 100%;
+  margin: 0px auto;
+  background: #fff;
+  // padding: 50px;
+  box-sizing: border-box;
+
+  h1 {
+    margin-bottom: 20px;
+    margin-top: 20px;
+    font-size: 16px;
+    color: #333;
+  }
+}
+// .tab{
+//   width: 100%;
+//   overflow: hidden;
+//   margin: auto;
+//   box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
+//   padding: 30px;
+
+// }
+.btn {
+  width: 50%;
+  margin: 50px auto 0;
+  display: flex;
+  justify-content: space-around;
+}
+</style>

+ 0 - 0
src/views/supplierPurchaseIn/supplierDeliveryWorkOrder/发货工单管理


+ 128 - 0
src/views/supplierPurchaseIn/supplierReturnWorkOrder/columns.js

@@ -0,0 +1,128 @@
+export default [
+  { type: 'selection', fixed: 'left', _noset_: true },
+  {
+    prop: 'id',
+    label: 'ID',
+    width: '40px'
+  },
+  {
+    prop: 'returnCode',
+    label: '售后申请单号',
+    width: '160'
+  },
+  {
+    prop: 'outChildCode',
+    label: '发货工单编号',
+    width: '160px'
+  },
+  {
+    prop: 'outCode',
+    label: '发货单编号',
+    width: '160'
+  },
+  {
+    prop: 'orderCode',
+    label: '订单编号',
+    width: '160px'
+  },
+  {
+    prop: 'use_type',
+    label: '平台类型',
+    _slot_: 'use_type'
+  },
+  {
+    prop: 'type',
+    label: '仓库类型',
+    width: '75px',
+    _slot_: 'stock_type'
+  },
+  {
+    prop: 'return_num',
+    label: '售后申请总数量',
+    width: '110px'
+  },
+  {
+    label: '最终入库数量',
+    _slot_: 'stcok_in',
+    width: '100px'
+  },
+  {
+    prop: 'order_type',
+    label: '商品类型',
+    _slot_: 'order_type',
+    width: '100px'
+  },
+  {
+    prop: 'good_code',
+    label: '商品编码',
+    width: '160px'
+  },
+  {
+    prop: 'good_name',
+    label: '商品名称',
+    width: '160px'
+  },
+  {
+    prop: 'return_wsm_code',
+    label: '退货仓库编码',
+    width: '130px'
+  },
+  {
+    prop: 'return_wsm_name',
+    label: '退货仓库名称',
+    width: '130px',
+    _slot_: 'returnWsm'
+  },
+  {
+    prop: 'return_contactor_name',
+    label: '退货仓库负责人',
+    width: '110px'
+  },
+  {
+    prop: 'send_wsm_code',
+    label: '发货仓库编码',
+    width: '130px'
+  },
+  {
+    prop: 'send_wsm_name',
+    label: '发货仓库名称',
+    width: '130px',
+    _slot_: 'sendWsm'
+  },
+  {
+    prop: 'send_contactor_name',
+    label: '发货仓库负责人',
+    width: '110px'
+  },
+  {
+    prop: 'companyNo',
+    label: '业务公司编号',
+    width: '150px'
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司名称',
+    width: '150px'
+  },
+  {
+    prop: 'apply_name',
+    label: '申请人',
+    width: '120px'
+  },
+  {
+    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	状态

+ 96 - 0
src/views/supplierPurchaseIn/supplierReturnWorkOrder/components/ShowDataTableColumns.js

@@ -0,0 +1,96 @@
+
+const showColumns = [
+  {
+    prop: 'returnCode',
+    label: '售后申请单号',
+    span: 7
+  },
+  {
+    prop: 'outChildCode',
+    label: '发货工单号',
+    span: 7
+  },
+  {
+    prop: 'type',
+    label: '仓库类型',
+    span: 4,
+    _slot_: 'stock_type'
+  },
+  {
+    prop: 'apply_name',
+    label: '创建人',
+    span: 6
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司',
+    _slot_: 'companyName',
+    span: 12
+  },
+  {
+    prop: 'customer_code',
+    label: '客户公司',
+    _slot_: 'customer',
+    span: 12
+  },
+  {
+    prop: 'send_wsm_code',
+    label: '发货仓库',
+    _slot_: 'sendWsm',
+    span: 12
+  },
+  {
+    prop: 'return_wsm_code',
+    label: '退货仓库',
+    _slot_: 'returnWsm',
+    span: 12
+  },
+  // {
+  //   prop: 'sale_price',
+  //   label: '销售价格',
+  //   span: 4
+  // },
+  // {
+  //   prop: 'total_price',
+  //   label: '总价',
+  //   span: 4
+  // },
+  // {
+  //   prop: 'num',
+  //   label: '下单数量',
+  //   span: 4
+  // },
+  {
+    prop: 'send_num',
+    label: '发货数量',
+    span: 4
+  },
+  {
+    prop: 'return_num',
+    label: '退货数量',
+    span: 4
+  },
+  {
+    prop: 'loss_num',
+    label: '丢失数量',
+    span: 4
+  },
+  {
+    prop: 'addtime',
+    label: '创建时间',
+    span: 12
+  },
+  {
+    prop: 'remark',
+    label: '备注',
+    span: 24
+  },
+  {
+    prop: 'record',
+    label: '标记',
+    span: 24,
+    _slot_: 'record'
+  }
+]
+
+export { showColumns }

+ 58 - 0
src/views/supplierPurchaseIn/supplierReturnWorkOrder/components/mark-modal.vue

@@ -0,0 +1,58 @@
+<template>
+  <el-dialog :visible.sync="innerVisible" title="退货工单标记" center>
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px" :loading="loading" @click="() => onMark()">保存</el-button>
+    <div style="clear:both" />
+  </el-dialog>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+import asyncRequest from '@/apis/service/sellOut/returnGoodWorkOrder'
+export default {
+  components: { VueEditor },
+  props: ['sitem', 'visible'],
+  data: () => ({
+    content: '',
+    loading: false
+  }),
+  computed: {
+    innerVisible: {
+      get() {
+        return this.visible
+      },
+      set(newValue) {
+        this.$emit('update:visible', newValue)
+      }
+    }
+  },
+  watch: {
+    visible: {
+      handler() {
+        if (!this.visible) return null
+        this.$nextTick(() => {
+          this.content = this.sitem.record
+        })
+      }
+    }
+  },
+  methods: {
+    async onMark() {
+      this.loading = true
+      const { code, message } = await asyncRequest.setAfterChildRecord({ record: this.content, id: this.sitem.id })
+      this.loading = false
+
+      switch (code) {
+        case 0:
+          this.content = ''
+          this.innerVisible = false
+          this.$emit('reload')
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 185 - 0
src/views/supplierPurchaseIn/supplierReturnWorkOrder/components/wait-stockman.vue

@@ -0,0 +1,185 @@
+<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="good_receive_type">
+          <el-select placeholder="货物情况" style="width:100%" v-model="ruleForm.good_receive_type">
+            <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="loss_num">
+          <digital-input
+            :values="ruleForm.loss_num"
+            :placeholder="'丢失数量'"
+            :min="0"
+            :max="100000000000"
+            :position="'right'"
+            :precision="0"
+            :size="'mini'"
+            :controls="false"
+            :append="''"
+            @reschange="number_change($event, 'loss_num')"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            placeholder="请输入备注"
+            type="textarea"
+            maxlength="100"
+            :size="'mini'"
+            v-model="ruleForm.remark"
+            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_loss_num = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
+      } else {
+        callback();
+      }
+    };
+
+    return {
+      status: "",
+      ruleForm: {
+        good_receive_type: "0", //发货物流公司
+        remark: "", //物流单号
+        loss_num: "",
+      },
+      statusOptions:[
+        { value:'0', label:'库房未发货无需追回'},
+        { value:'1', label:'库房已发货无全部追回'},
+        { value:'2', label:'库房已发货已无法追回'},
+        { value:'3', label:'库房已发货已部分追回'},
+      ],
+      rules: {
+        good_receive_type: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择发货公司",
+            trigger: "change",
+          },
+        ],
+        loss_num: [
+          {
+            required: true,
+            validator: validate_loss_num,
+            trigger: "blur",
+          },
+        ],
+        remark: [
+          {
+            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.good_receive_type = model.good_receive_type.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.good_receive_type = e && e.code ? [e.label] : [];
+      this.$refs.ruleForm.validateField("good_receive_type");
+    },
+  },
+};
+</script>

+ 36 - 0
src/views/supplierPurchaseIn/supplierReturnWorkOrder/components/work-order-mark.vue

@@ -0,0 +1,36 @@
+<template>
+  <div class="work-order-mark__wrapper">
+    <vue-editor v-model="content" />
+    <el-button class="fr" type="primary" size="mini" style="margin:10px 0px" @click="() => onMark()">保存</el-button>
+  </div>
+</template>
+
+<script>
+import { VueEditor } from 'vue2-editor'
+import asyncRequest from '@/apis/service/sellOut/returnGoodWorkOrder'
+export default {
+  components: { VueEditor },
+  props: ['sitem'],
+  data: () => ({
+    content: '',
+    loading: false
+  }),
+  methods: {
+    async onMark() {
+      this.loading = true
+      const { code, message } = await asyncRequest.setAfterChildRecord({ record: this.content, id: this.sitem.id })
+      this.loading = false
+
+      switch (code) {
+        case 0:
+          this.content = ''
+          this.$emit('reload')
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 236 - 0
src/views/supplierPurchaseIn/supplierReturnWorkOrder/detail.vue

@@ -0,0 +1,236 @@
+<template>
+  <div class="sellReturnDetail pagePadding">
+    <div style="display:flex;justify-content:flex-end;align-items:center">
+        <el-button type="primary" plain size="mini" @click="visible = true">退货工单标记</el-button>
+    </div>
+
+    <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) || {}).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="stock_type">
+                  <el-tag size="mini">{{sitem.type === '1' ? '销售仓' : '次品仓'}}</el-tag>
+                </template>
+
+                <template slot="record">
+                  <div class="ql-editor"  v-html="sitem.record"></div>
+                </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>f=
+                    <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="360" 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="returnWsm">
+                  <span>{{ sitem.return_wsm_name }}</span>
+                  <el-popover placement="top" width="360" trigger="hover">
+                    <ul>
+                      <li><h3>退货仓库</h3></li>
+                      <li>
+                        <span>编号:</span
+                        ><span>{{ sitem.return_wsm_code }}</span>
+                      </li>
+                      <li>
+                        <span>名称:</span
+                        ><span>{{ sitem.return_wsm_name}}</span>
+                      </li>
+                      <li>
+                        <span>负责人:</span
+                        ><span>xx</span>
+                      </li>
+                      <li>
+                        <span>供应商编码:</span
+                        ><span>{{ sitem.return_supplierNo }}</span>
+                      </li>
+                      <li>
+                        <span>供应商名称:</span
+                        ><span>{{ sitem.return_supplierName }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference" />
+                  </el-popover>
+                </template>
+
+                <template slot="sendWsm">
+                  <span>{{ sitem.send_wsm_name }}</span>
+                  <el-popover placement="top" width="360" trigger="hover">
+                    <ul>
+                      <li><h3>发货仓库</h3></li>
+                      <li>
+                        <span>编号:</span
+                        ><span>{{ sitem.send_wsm_code }}</span>
+                      </li>
+                      <li>
+                        <span>名称:</span
+                        ><span>{{ sitem.send_wsm_name }}</span>
+                      </li>
+                      <li>
+                        <span>负责人:</span
+                        ><span>xx</span>
+                      </li>
+                      <li>
+                        <span>供应商编码:</span
+                        ><span>{{ sitem.send_supplierNo }}</span>
+                      </li>
+                      <li>
+                        <span>供应商名称:</span
+                        ><span>{{ sitem.send_supplierName }}</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="360" 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="2">
+              <show-goods-data-table :type="order_type" :spucode="spuCode" iscgd :newTime="newTime"  />
+           </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+
+    <mark-modal :visible.sync="visible" :sitem="sitem" @reload="() => initData()" />
+  </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 WorkOrderMark from "./components/work-order-mark.vue"
+import MarkModal from "./components/mark-modal.vue";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "deliveryWorkOrderDetail",
+  mixins: [mixinPage, resToken],
+  components: { WorkOrderMark , MarkModal},
+  computed: {
+    ...mapGetters(['isSupertube']),
+    powers() {
+      const {btnList} = this.$store.getters;
+      const tran = btnList.find((item) => item.menu_route == "supplierReturnWorkOrderDetail" ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      activeTabs: "1",
+      visible: false,
+      spuCode:"",
+      order_type:"",
+      showColumns: showColumns,
+      statusOptions: [
+        { value: "1", label: "待主流程收货" },
+        { value: "2", label: "主流程已收货" }
+      ],
+      xs_order_type_options,
+      sitem: null, //传给组件
+      activeNames: ["0", "1", "2", "3", "4", "5", "6"],
+      status: "", //存储详情接口状态
+      statusList: [
+        { value: "1", label: "待收货" },
+        { value: "2", label: "已收货" }
+      ],
+      newTime: "",
+      loading: false,
+      is_stock: "",
+      queryId: "",
+    };
+  },
+  mounted() {
+    this.queryId = this.$route.query.id;
+    this.initData();
+  },
+  methods: {
+    async initData() {
+      const { code, data, message } = await asyncRequest.detail({
+        id: this.queryId,
+      });
+      if (code === 0) {
+        const { is_stock, status ,spuCode,order_type } = data;
+        this.spuCode = spuCode
+        this.order_type = order_type
+        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>

+ 656 - 0
src/views/supplierPurchaseIn/supplierReturnWorkOrder/index.vue

@@ -0,0 +1,656 @@
+<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="3" style="width: 120px">
+                <el-switch 
+                  v-model="parmValue.use_type"
+                  :active-value="usetypeOtions[1].value"
+                  :inactive-value="usetypeOtions[0].value"
+                  :active-text="usetypeOtions[1].label"
+                  :inactive-text="usetypeOtions[0].label"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                />
+              </el-col>
+              <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_source"
+                  filterable
+                  clearable
+                  placeholder="订单来源"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_source_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.order_type"
+                  filterable
+                  clearable
+                  placeholder="商品类型"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in xs_order_type_options"
+                    :key="'orderstatus' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+
+              <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
+                <search-work-company
+                  :value="parmValue.companyNo"
+                  :placeholder="'业务公司'"
+                  style="width: 100%"
+                  :size="searchSize"
+                  @searchChange="companyNosearchChange"
+                />
+              </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-row>
+            <el-row style="padding: 10px 0 0 0">
+              <el-col :span="4" style="width: 200px">
+                <el-select
+                  style="width: 100%"
+                  placeholder="状态"
+                  size="mini"
+                  clearable
+                  v-model="parmValue.status"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option label="待收货" value="1" />
+                  <el-option label="已收货" value="2" />
+                </el-select>
+              </el-col>
+              <el-col :span="8" style="width: 502px; padding: 0 0 0 10px">
+                <el-input
+                  placeholder="关键字"
+                  size="mini"
+                  v-model="parmValue.queryValue"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <template #prepend>
+                    <el-select
+                      style="width: 150px"
+                      v-model="parmValue.queryKey"
+                      @change="
+                        pageInfo.curr = 1;
+                        parmValue.page = 1;
+                        searchList();
+                      "
+                    >
+                      <el-option value="returnCode" label="售后申请单编码" />
+                      <el-option value="orderCode" label="订单编码" />
+                      <el-option value="outChildCode" label="发货工单编码" />
+                      <!-- <el-option value="return_wsm_code" label="退货仓库编码" /> -->
+                    </el-select>
+                  </template>
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  ></el-button>
+                </el-input>
+              </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-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 #stcok_in="{scope}">{{
+            scope.row.type === "1" ? scope.row.can_sell_num : scope.row.defective_num
+        }}</template>
+
+        <template #returnWsm="{ scope }">
+          <el-popover placement="top" width="360" trigger="hover">
+            <i class="el-icon-warning-outline" slot="reference"></i>
+            <ul>
+              <li><h3>退货仓库</h3></li>
+              <li>
+                <span>编号:</span><span>{{ scope.row.return_wsm_code }}</span>
+              </li>
+              <li>
+                <span>名称:</span><span>{{ scope.row.return_wsm_name }}</span>
+              </li>
+              <li>
+                <span>负责人:</span><span>{{ scope.row.return_contactor_name }}</span>
+              </li>
+              <li>
+                <span>供应商编码:</span><span>{{ scope.row.return_supplierNo }}</span>
+              </li>
+              <li>
+                <span>供应商名称:</span><span>{{ scope.row.return_supplierName }}</span>
+              </li>
+            </ul>
+          </el-popover>
+          <span>{{ scope.row.return_wsm_name }}</span>
+        </template>
+
+        <template #order_type="{ scope }">
+          <el-tag size="mini">{{
+            (xs_order_type_options.find(({ id }) => id === scope.row.order_type) || {})
+              ?.label || "--"
+          }}</el-tag>
+        </template>
+
+        <template #use_type="{ scope }">
+          <el-tag size="mini">
+            {{
+              (usetypeOtions.find(({ value }) => value === scope.row.use_type) || {})
+                .label || "---"
+            }}
+          </el-tag>
+        </template>
+
+        <template #stock_type="{ scope }">
+          <el-tag :type="scope.row.type !== '1' ? 'warning' : ''" size="mini">{{
+            scope.row.type === "1" ? "销售仓" : "次品仓"
+          }}</el-tag>
+        </template>
+
+        <template #sendWsm="{ scope }">
+          <el-popover placement="top" width="360" trigger="hover">
+            <i class="el-icon-warning-outline" slot="reference"></i>
+            <ul>
+              <li><h3>退货仓库</h3></li>
+              <li>
+                <span>编号:</span><span>{{ scope.row.send_wsm_code }}</span>
+              </li>
+              <li>
+                <span>名称:</span><span>{{ scope.row.send_wsm_name }}</span>
+              </li>
+              <li>
+                <span>负责人:</span><span>{{ scope.row.send_contactor_name }}</span>
+              </li>
+              <li>
+                <span>供应商编码:</span><span>{{ scope.row.send_supplierNo }}</span>
+              </li>
+              <li>
+                <span>供应商名称:</span><span>{{ scope.row.send_supplierName }}</span>
+              </li>
+            </ul>
+          </el-popover>
+          <span>{{ scope.row.send_wsm_name }}</span>
+        </template>
+
+        <template #type="{ scope }">
+          <el-tag size="mini">{{
+            scope.row.type === "1" ? "未发货退货" : "售后申请"
+          }}</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.id)"
+            ></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 asyncRequest from "@/apis/service/sellOut/returnGoodWorkOrder";
+import { xs_order_type_options ,xs_order_source_options, usetypeOtions} from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper"
+import urlConfig from "@/apis/url-config";
+import { mapGetters } from "vuex";
+import columns from "./columns";
+
+
+
+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 {
+      usetypeOtions,
+      companyNo: "",
+      xs_order_type_options,
+      xs_order_source_options,
+      fileUrl: urlConfig.baseURL,
+      select: "outChildCode", //默认选择下拉框
+      s_input: "", //搜索框内容
+      select_list:[],
+      supplierNo:[],
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { value: "1", label: "待主流程收货" },
+        { value: "2", label: "主流程已收货" },
+      ],
+      loading: false,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        queryKey:"returnCode",
+        queryValue:"",
+        companyNo:"",
+        use_type : "1",
+        type:'',
+        order_type: "",
+        returnCode:"",
+        status: "",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        // order_type: "",
+      },
+      queryKey: "",
+      queryValue: "",
+      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 companyNosearchChange(e) {
+      const { code } = e
+      this.parmValue.companyNo = 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,
+            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 = {
+        queryKey:'returnCode',
+        queryValue:"",
+        use_type:'1',
+        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,
+        is_authority: "1",
+        // [this.parmValue.select]: this.s_input,
+        [this.parmValue.queryKey]: this.queryValue,
+        companyNo: this.companyNo,
+        supplierNo: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/supplierPurchaseIn/supplierReturnWorkOrder/退货工单管理