ソースを参照

feat:
1. 线下销售订单-支持添加商品信息
2. 销售退货单(列表、新增、编辑、详情、审核)

Moss 1 年間 前
コミット
5675e970d0

+ 56 - 0
src/api/order.js

@@ -359,4 +359,60 @@ export function getPrintList(params) {
     method: 'post',
     params
   })
+}
+
+
+
+// 获取销售退货单列表
+export function getSalesReturnOrderList(data) {
+  return request({
+    url: `/order/offline/refund/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+// 销售退货单详情
+export function getSalesReturnOrderDetail(params) {
+  return request({
+    url: '/order/offline/refund/detail',
+    method: 'post',
+    params
+  })
+}
+
+// 导出销售退货单列表
+export function salesReturnOrderListExport(data, name) {
+  return postBlob({
+    url: '/order/offline/refund/list/export',
+    data,
+    name
+  })
+}
+
+// 销售退货单保存
+export function salesReturnOrderSave(params) {
+  return request({
+    url: '/order/offline/refund/save',
+    method: 'post',
+    data: params
+  })
+}
+
+// 销售退货单审批
+export function salesReturnOrderExamine(params) {
+  return request({
+    url: '/order/offline/refund/examine',
+    method: 'post',
+    params
+  })
+}
+
+// 订单条码列表
+export function getOrderCodeList(params) {
+  return request({
+    url: '/order/offline/refund/code/list',
+    method: 'post',
+    params
+  })
 }

+ 101 - 5
src/views/mallManagement/order/offline_order_list/index.vue

@@ -148,7 +148,8 @@
           <el-divider></el-divider>
 
           <div>
-            <el-button type="primary" size="small" @click="addGoods">添加</el-button>
+            <el-button type="primary" size="small" @click="addGoods(1)">添加商品</el-button>
+            <el-button type="primary" size="small" @click="addGoods(2)">添加物料</el-button>
           </div>
           <el-table
             class="specTable"
@@ -175,7 +176,28 @@
             </el-table-column>
             <el-table-column align="center" label="商品名称" prop="goodsMaterialId" min-width="160">
               <template slot-scope="scope">
-                <el-select size="small" v-model="scope.row.goodsMaterialId" filterable placeholder="请选择" @change="changeSpec(scope.$index, scope.row)">
+                <el-select
+                  size="small"
+                  v-model="scope.row.goodsId"
+                  filterable
+                  placeholder="请选择"
+                  @change="changeGoods(scope.$index, scope.row)"
+                  v-if="scope.row.flag == 1">
+                  <el-option
+                    v-for="item in goodsSelectList"
+                    :key="item.goodsId"
+                    :label="item.goodsName"
+                    :value="item.goodsId">
+                  </el-option>
+                </el-select>
+                
+                <el-select
+                  size="small"
+                  v-model="scope.row.goodsMaterialId"
+                  filterable
+                  placeholder="请选择"
+                  @change="changeSpec(scope.$index, scope.row)"
+                  v-if="scope.row.flag == 2">
                   <el-option
                     v-for="item in goodsSpecList"
                     :key="item.id"
@@ -187,7 +209,28 @@
             </el-table-column>
             <el-table-column align="center" label="规格型号" prop="goodsMaterialId" min-width="160">
               <template slot-scope="scope">
-                <el-select size="small" v-model="scope.row.goodsMaterialId" filterable placeholder="请选择" @change="changeSpec(scope.$index, scope.row)">
+                <el-select
+                  size="small"
+                  v-model="scope.row.goodsSpecId"
+                  filterable
+                  placeholder="请选择"
+                  @change="changeGoodSpec(scope.$index, scope.row)"
+                  v-if="scope.row.flag == 1">
+                  <el-option
+                    v-for="item in goodsSelectList.find(o => o.goodsId == scope.row.goodsId) ? goodsSelectList.find(o => o.goodsId == scope.row.goodsId).goodsSpecs : []"
+                    :key="item.goodsSpecId"
+                    :label="item.specValue"
+                    :value="item.goodsSpecId">
+                  </el-option>
+                </el-select>
+
+                <el-select
+                  size="small"
+                  v-model="scope.row.goodsMaterialId"
+                  filterable
+                  placeholder="请选择"
+                  @change="changeSpec(scope.$index, scope.row)"
+                  v-if="scope.row.flag == 2">
                   <el-option
                     v-for="item in goodsSpecList"
                     :key="item.id"
@@ -424,10 +467,11 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { getOfflineOrderList, offlineOrderListExport, offlineOrderSave, getOfflineOrderDetail, offlineOrderExamine, getOrderTypeList } from "@/api/order";
-import { getGoodsSpecList } from '@/api/goods'
+import { getGoodsSpecList, getGoodsList } from '@/api/goods'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import geographicalPosi from '@/components/geographicalPosi/index.vue'
 import QRCode from "qrcodejs2";
+
 export default {
   components: { TemplatePage, geographicalPosi },
   mixins: [import_mixin,operation_mixin],
@@ -531,6 +575,7 @@ export default {
       streetList: [],
       goodsList: [],
       goodsSpecList: [],
+      goodsSelectList: [],
 
       detailData: {},
       examineFormData: {
@@ -658,6 +703,7 @@ export default {
       		this.$nextTick(()=>{
             this.getOrderTypeList();
             this.getGoodsSpecList();
+            this.getGoodsList();
       			this.formType = type
       			this.formVisible = true
             if (type == 'add') {
@@ -668,6 +714,9 @@ export default {
       				getOfflineOrderDetail({ orderId }).then(res => {
                 res.data.orderSmallType = res.data.orderDetails[0]?.orderSmallType;
                 res.data.orderSmallTypeText = res.data.orderDetails[0]?.orderSmallTypeText;
+                res.data.orderDetails.forEach(item => {
+                  item.unit = item.goodsMaterialUnit;
+                })
                 this.goodsList = res.data.orderDetails;
       				  Object.assign(this.formData, res.data)
                 this.getinitlbslist();
@@ -956,6 +1005,16 @@ export default {
       })
     },
 
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then(res => {
+        this.goodsSelectList = res.data.records;
+      })
+    },
+
     // 获取规格列表
     getGoodsSpecList() {
       getGoodsSpecList({
@@ -968,8 +1027,11 @@ export default {
     },
 
     // 添加商品
-    addGoods() {
+    addGoods(flag) {
       let obj = {
+        flag: flag,
+        goodsId: '',
+        goodsSpecId: '',
         goodsMaterialId: '', // 物料编号
         brandId: '', // 品牌id
         brandName: '', // 品牌名称
@@ -1043,6 +1105,40 @@ export default {
       }
     },
 
+    // 选择商品
+    changeGoods(index, row) {
+      let item = this.goodsSelectList.find(o => o.goodsId == row.goodsId);
+      this.goodsList[index].goodslId = item.goodsId;
+      this.goodsList[index].brandId = item.brandId;
+      this.goodsList[index].brandName = item.brandName;
+      this.goodsList[index].goodsName = item.goodsName;
+      this.goodsList[index].specsName = item.specsName;
+      this.goodsList[index].insideNum = 1;
+      this.goodsList[index].outNum = 1;
+      this.goodsList[index].partsNum = 0;
+
+      this.goodsList[index].goodsSpecId = '';
+      this.goodsList[index].mainId = '';
+      this.goodsList[index].mainName = '';
+      this.goodsList[index].smallId = '';
+      this.goodsList[index].smallName = '';
+      this.goodsList[index].unit = '';
+      this.goodsList[index].stockQty = '';
+    },
+
+    // 选择商品规格
+    changeGoodSpec(index, row) {
+      let list = this.goodsSelectList.find(o => o.goodsId == row.goodsId).goodsSpecs;
+      let item = list.find(o => o.goodsSpecId == row.goodsSpecId);
+      
+      this.goodsList[index].mainId = item.mainId;
+      this.goodsList[index].mainName = item.mainName;
+      this.goodsList[index].smallId = item.smallId;
+      this.goodsList[index].smallName = item.smallName;
+      this.goodsList[index].unit = item.unit;
+      this.goodsList[index].stockQty = item.stockNum;
+    },
+
     creatCode(data, orderId) {
       this.showCodeDialog = true;
       this.$nextTick(() => {

+ 14 - 0
src/views/mallManagement/order/order_list/index.vue

@@ -252,6 +252,7 @@
                           v-if="(order.orderStatus === 'NOPAY' || order.orderStatus === 'DQR') && $restrict('cancelOrder')">
                           <el-button slot="reference" type="text" size="small">取消订单</el-button>
                         </el-popconfirm>
+                        <el-button type="text" size="small" @click="returnOrder(order.orderId)" v-if="(order.orderStatus === 'YFH' || order.orderStatus === 'OVER') && $restrict('returnOrder')">发起退货</el-button>
                         <el-button type="text" size="small" v-if="order.orderStatus === 'DFH' && $restrict('deliver')"
                           @click="showLogistics(order, 'add')">发货</el-button>
                         <el-button type="text" size="small" v-if="order.orderStatus === 'DFH' && $restrict('changeShippingaddress')"
@@ -1092,6 +1093,7 @@ export default {
         this.$successMsg('保存成功');
       })
     },
+
     // 取消订单
     cancelOrder(orderId) {
       cancelOrder({ orderId }).then(() => {
@@ -1099,6 +1101,7 @@ export default {
         this.$successMsg('取消成功');
       })
     },
+
     // 确认订单
     confirmOrder(orderId) {
       confirm2Order({ orderId }).then(() => {
@@ -1106,6 +1109,17 @@ export default {
         this.$successMsg('确认成功');
       })
     },
+
+    // 发起退货
+    returnOrder(orderId) {
+      this.$router.push({
+        name: "sales_return_order_list",
+        query: {
+          orderId
+        }
+      })
+    },
+
     // 查看物流
     queryLogistics(order) {
       this.logisticsVisible = true

+ 955 - 0
src/views/mallManagement/order/sales_return_order_list/index.vue

@@ -0,0 +1,955 @@
+<template>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
+		<template slot-scope="{activeKey, data}">
+			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+			  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
+			  :operation="operation()" :exportList="exportList">
+        <div slot="moreSearch">
+          <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
+            <el-radio-button label="">全部</el-radio-button>
+            <el-radio-button label="SAVE">保存</el-radio-button>
+            <el-radio-button label="SUBMIT">提交</el-radio-button>
+            <el-radio-button label="WAIT">待审核</el-radio-button>
+            <el-radio-button label="OK">审核通过</el-radio-button>
+            <el-radio-button label="FAIL">审核驳回</el-radio-button>
+          </el-radio-group>
+          <br><br>
+        </div>
+			</template-page>
+
+      <div v-if="~['add', 'edit'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
+
+				<el-form ref="formRef" :model="formData" :rules="formRules" label-position="left" label-width="90px">
+
+          <div style="font-weight: 500;">单据信息</div>
+          <el-divider></el-divider>
+
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="所属商户" prop="companyWechatName">
+                <el-input v-model="formData.companyWechatName" autocomplete="off" placeholder="请输入所属商户" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="销售订单号" prop="orderId">
+                <div style="display: flex; align-items: center;">
+                  <el-input v-model="formData.orderId" autocomplete="off" placeholder="请选择" disabled></el-input>
+                  <el-button type="primary" size="small" @click="openOrderDialog" style="margin-left: 10px;" :disabled="!!formData.id">选择</el-button>
+                </div>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="销售类型" prop="saleType">
+                <el-radio-group v-model="formData.saleType" disabled>
+                  <el-radio :label="1">商城订单</el-radio>
+                  <el-radio :label="2">线下订单</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="6">
+              <el-form-item label="业务员" prop="saleName">
+                <el-input v-model="formData.saleName" autocomplete="off" placeholder="请输入业务员" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="业务员电话" prop="saleMobile">
+                <el-input v-model="formData.saleMobile" autocomplete="off" placeholder="请输入业务员电话" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :span="6">
+              <el-form-item label="工单类型" prop="orderSmallType">
+                <el-select v-model="formData.orderSmallType" placeholder="请选择" disabled>
+                  <el-option
+                    v-for="item in orderTypeList"
+                    :key="item.id"
+                    :label="item.orderSmallTypeText"
+                    :value="item.id">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="6">
+              <el-form-item label="下单时间" prop="createTime">
+                <el-input v-model="formData.createTime" autocomplete="off" placeholder="请输入下单时间" disabled></el-input>
+              </el-form-item>
+            </el-col>
+
+          </el-row>
+          <el-row :gutter="20">
+
+            <el-col :span="6">
+              <el-form-item label="客户名称" prop="receUserName">
+                <el-input v-model="formData.receUserName" autocomplete="off" placeholder="请输入客户名称" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="客户电话" prop="recePhone">
+                <el-input v-model="formData.recePhone" autocomplete="off" placeholder="请输入客户电话" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="地址" prop="receAddress">
+                <el-input type="text" v-model="formData.receAddress" placeholder="详细地址" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注" prop="remark">
+                <el-input type="textarea" v-model="formData.remark" autocomplete="off" placeholder="请输入备注"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="附件" prop="fileUrl">
+                <el-upload class="avatar-uploader" style="height:122px" :action="baseURL + 'common/upload'" :headers="myHeaders"
+                  :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload">
+                  <img v-if="formData.fileUrl" :src="formData.fileUrl" class="avatar">
+                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-tabs v-model="curTabs">
+            <el-tab-pane label="商品信息" name="a"></el-tab-pane>
+            <el-tab-pane label="条码信息" name="b"></el-tab-pane>
+          </el-tabs>
+
+          <div v-show="curTabs == 'a'">
+            <el-table
+              class="specTable"
+              :data="goodsList"
+              element-loading-text="Loading"
+              border
+              highlight-current-row
+              stripe
+              style="margin-top: 20px">
+              <el-table-column align="center" label="大类" prop="mainName" min-width="120"></el-table-column>
+              <el-table-column align="center" label="小类" prop="smallName" min-width="120"></el-table-column>
+              <el-table-column align="center" label="商品名称" prop="goodsName" min-width="200"></el-table-column>
+              <el-table-column align="center" label="规格型号" prop="goodsSpecName" min-width="200"></el-table-column>
+              <el-table-column align="center" label="单位" prop="goodsMaterialUnit" min-width="120">
+                <template slot-scope="scope">
+                  {{scope.row.goodsMaterialUnit | unitFilter}}
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="退货数量" prop="waitRefundNum" min-width="120">
+                <template slot-scope="scope">
+                  <el-input size="small" v-model="scope.row.waitRefundNum"></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="退货单价" prop="waitRefundPrice" min-width="120">
+                <template slot-scope="scope">
+                  <el-input size="small" v-model="scope.row.waitRefundPrice"></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="退货金额" prop="amount" min-width="120">
+                <template slot-scope="scope">
+                  {{scope.row.waitRefundNum * scope.row.waitRefundPrice * 100 / 100}}
+                </template>
+              </el-table-column>
+
+              <el-table-column align="center" label="已退数量" prop="refundNum" min-width="120"></el-table-column>
+              <el-table-column align="center" label="已退单价" min-width="120">
+                <template slot-scope="scope">
+                  {{(scope.row.refundAmount / scope.row.refundNum) || 0}}
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="已退金额" prop="refundAmount" min-width="120"></el-table-column>
+              <el-table-column align="center" label="订单数量" prop="num" min-width="120"></el-table-column>
+              <el-table-column align="center" label="订单单价" prop="price" min-width="120"></el-table-column>
+              <el-table-column align="center" label="订单金额" prop="payAmount" min-width="120"></el-table-column>
+
+              <el-table-column align="center" label="操作" min-width="100" fixed="right">
+                <template slot-scope="scope">
+                  <el-popconfirm title="确定删除吗?" @confirm="deleteGoods(scope.$index)">
+                    <el-button slot="reference" type="text">删除</el-button>
+                  </el-popconfirm>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+          <div v-show="curTabs == 'b'">
+            <el-table
+              class="specTable"
+              :data="codeList"
+              element-loading-text="Loading"
+              border
+              highlight-current-row
+              stripe
+              style="margin-top: 20px">
+              <el-table-column align="center" label="品牌" prop="brandName" min-width="120"></el-table-column>
+              <el-table-column align="center" label="大类" prop="mainName" min-width="120"></el-table-column>
+              <el-table-column align="center" label="小类" prop="smallName" min-width="120"></el-table-column>
+              <el-table-column align="center" label="商品名称" prop="goodsMaterialName" min-width="200"></el-table-column>
+              <el-table-column align="center" label="规格型号" prop="specsName" min-width="200"></el-table-column>
+              <el-table-column align="center" label="物料类型" prop="materialName" min-width="120"></el-table-column>
+              <el-table-column align="center" label="物料名称" prop="goodsMaterialName" min-width="120"></el-table-column>
+              <el-table-column align="center" label="是否一物一码" prop="uniqueCode" min-width="120">
+                <template slot-scope="scope">
+                  {{scope.row.uniqueCode == 'YES' ? '是' : '否'}}
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="条码" prop="materialCode" min-width="120"></el-table-column>
+              <el-table-column align="center" label="数量" prop="stockQty" min-width="120"></el-table-column>
+              <el-table-column align="center" label="操作" min-width="100" fixed="right">
+                <template slot-scope="scope">
+                  <el-popconfirm title="确定删除吗?" @confirm="deleteCode(scope.$index)">
+                    <el-button slot="reference" type="text">删除</el-button>
+                  </el-popconfirm>
+                </template>
+              </el-table-column>
+
+            </el-table>
+          </div>
+          
+          
+        </el-form>
+				<div slot="footer" class="dialog-footer" style="margin-top: 20px;">
+				  <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+				  <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
+				</div>
+			</div>
+
+      <div v-if="~['detail', 'examine'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
+        <div style="font-weight: 500;">单据信息</div>
+        <el-divider></el-divider>
+
+        <el-descriptions border title="" :column="3" :colon="false" labelStyle="width: 8%" contentStyle="width: 17%">
+          <el-descriptions-item label="所属商户">
+            {{detailData.companyWechatName}}
+          </el-descriptions-item>
+          <el-descriptions-item label="订单单号">
+            {{detailData.orderId}}
+          </el-descriptions-item>
+          <el-descriptions-item label="销售类型">
+            {{detailData.orderInfo.saleType | saleTypeFilter}}
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions border title="" :column="3" :colon="false" labelStyle="width: 8%" contentStyle="width: 17%" style="margin-top: -1px">
+          <el-descriptions-item label="业务员">
+            {{detailData.orderInfo.saleName}}
+          </el-descriptions-item>
+          <el-descriptions-item label="业务员电话">
+            {{detailData.orderInfo.saleMobile}}
+          </el-descriptions-item>
+          <el-descriptions-item label="下单时间">
+            {{detailData.orderInfo.createTime}}
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions border title="" :column="3" :colon="false" labelStyle="width: 8%" contentStyle="width: 17%" style="margin-top: -1px">
+          <el-descriptions-item label="客户姓名">
+            {{detailData.orderInfo.receUserName}}
+          </el-descriptions-item>
+          <el-descriptions-item label="客户电话">
+            {{detailData.orderInfo.recePhone}}
+          </el-descriptions-item>
+          <el-descriptions-item label=""></el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions border title="" :column="1" :colon="false" labelStyle="width: 8%" contentStyle="width: 92%" style="margin-top: -1px">
+          <el-descriptions-item label="地址">
+            {{detailData.orderInfo.receAddress}}
+          </el-descriptions-item>
+          <el-descriptions-item label="附件">
+            <el-image 
+              v-if="detailData.fileUrls"
+              style="width: 100px; height: 100px"
+              :src="detailData.fileUrls" 
+              :preview-src-list="[detailData.fileUrls]">
+            </el-image>
+          </el-descriptions-item>
+          <el-descriptions-item label="备注">
+            {{detailData.remark}}
+          </el-descriptions-item>
+        </el-descriptions>
+
+        <el-tabs v-model="curTabs">
+          <el-tab-pane label="商品信息" name="a"></el-tab-pane>
+          <el-tab-pane label="条码信息" name="b"></el-tab-pane>
+        </el-tabs>
+
+        <div v-show="curTabs == 'a'">
+          <el-table
+            class="specTable"
+            :data="detailData.orderOfflineRefundItems"
+            element-loading-text="Loading"
+            border
+            highlight-current-row
+            stripe
+            style="margin-top: 20px">
+            <el-table-column align="center" label="大类" prop="mainName" min-width="120"></el-table-column>
+            <el-table-column align="center" label="小类" prop="smallName" min-width="120"></el-table-column>
+            <el-table-column align="center" label="商品名称" prop="goodsName" min-width="200"></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="goodsSpecName" min-width="200"></el-table-column>
+            <el-table-column align="center" label="单位" prop="goodsMaterialUnit" min-width="120">
+              <template slot-scope="scope">
+                {{scope.row.goodsMaterialUnit | unitFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="退货数量" prop="refundNum" min-width="120"></el-table-column>
+            <el-table-column align="center" label="退货单价" prop="" min-width="120">
+              <template slot-scope="scope">
+                {{(scope.row.refundAmount / scope.row.refundNum) || 0}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="退货金额" prop="refundAmount" min-width="120"></el-table-column>
+
+            <el-table-column align="center" label="已退数量" prop="retiredNum" min-width="120"></el-table-column>
+            <el-table-column align="center" label="已退单价" min-width="120">
+              <template slot-scope="scope">
+                {{(scope.row.retiredAmount / scope.row.retiredNum) || 0}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="已退金额" prop="retiredAmount" min-width="120"></el-table-column>
+            <el-table-column align="center" label="订单数量" prop="num" min-width="120"></el-table-column>
+            <el-table-column align="center" label="订单单价" prop="price" min-width="120"></el-table-column>
+            <el-table-column align="center" label="订单金额" prop="payAmount" min-width="120"></el-table-column>
+          </el-table>
+        </div>
+        <div v-show="curTabs == 'b'">
+          <el-table
+            class="specTable"
+            :data="detailData.orderOfflineItemCodes"
+            element-loading-text="Loading"
+            border
+            highlight-current-row
+            stripe
+            style="margin-top: 20px">
+            <el-table-column align="center" label="品牌" prop="brandName" min-width="120"></el-table-column>
+            <el-table-column align="center" label="大类" prop="mainName" min-width="120"></el-table-column>
+            <el-table-column align="center" label="小类" prop="smallName" min-width="120"></el-table-column>
+            <el-table-column align="center" label="商品名称" prop="goodsMaterialName" min-width="200"></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="specsName" min-width="200"></el-table-column>
+            <el-table-column align="center" label="物料类型" prop="materialName" min-width="120"></el-table-column>
+            <el-table-column align="center" label="物料名称" prop="goodsMaterialName" min-width="120"></el-table-column>
+            <el-table-column align="center" label="是否一物一码" prop="uniqueCode" min-width="120">
+              <template slot-scope="scope">
+                {{scope.row.uniqueCode == 'YES' ? '是' : '否'}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="条码" prop="materialCode" min-width="120"></el-table-column>
+            <el-table-column align="center" label="数量" prop="stockQty" min-width="120"></el-table-column>
+
+          </el-table>
+        </div>
+
+				<div slot="footer" class="dialog-footer" style="margin-top: 20px;">
+				  <el-button size="mini" @click="data.removeTab()">关 闭</el-button>
+				  <el-button size="mini" @click="detailConfirm(data.removeTab)" type="primary" v-if="activeKey == 'examine'">审核通过</el-button>
+				</div>
+      </div>
+
+
+      <el-dialog
+        title="选择销售订单"
+        :visible.sync="isShowOrderDialog"
+        :close-on-click-modal="false"
+        :show-close="false"
+        width="800px">
+
+        <div class="screen-container">
+          <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
+            <el-row :gutter="20">
+              <el-col :span="8">
+                <el-form-item label="销售订单号" prop="orderId">
+                  <el-input v-model="screenForm.orderId" placeholder="请输入销售订单号"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="客户名称" prop="userName">
+                  <el-input v-model="screenForm.userName" placeholder="请输入客户名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="客户电话" prop="phone">
+                  <el-input v-model="screenForm.phone" placeholder="请输入客户电话"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="商品名称" prop="productName">
+                  <el-input v-model="screenForm.productName" placeholder="请输入商品名称"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label=""></el-form-item>
+              </el-col>
+              <el-col :span="8" class="tr">
+                <el-form-item label="">
+                  <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+                  <el-button size="small" @click="resetScreenForm">清空</el-button>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </div>
+
+        <div class="table" style="margin: 10px 0 20px;">
+          <el-table
+            border
+            :data="orderList" 
+            element-loading-text="Loading" 
+            tooltip-effect="dark" 
+            style="width: 100%" 
+            max-height="270"
+            @selection-change="handleChooseGoods">
+            <el-table-column align="center" type="selection" width="45"></el-table-column>
+            <el-table-column align="center" prop="orderId" label="订单号" min-width="180"></el-table-column>
+            <el-table-column align="center" prop="orderStatus" label="状态" min-width="80">
+              <template slot-scope="scope">
+                {{scope.row.orderStatus | ORDER_CURRENT_STATUS_FILTER}}
+              </template>
+            </el-table-column>
+            <!-- <el-table-column align="center" prop="goodsPrice" label="品牌" min-width="80"></el-table-column> -->
+            <!-- <el-table-column align="center" prop="goodsPrice" label="大类" min-width="80"></el-table-column> -->
+            <!-- <el-table-column align="center" prop="goodsPrice" label="小类" min-width="80"></el-table-column> -->
+            <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200">
+              <template slot-scope="scope">
+                <div style="text-align: left;" v-for="(item, index) in scope.row.orderDetails" :key="index"><span v-if="scope.row.orderDetails.length > 1">{{index+1}}. </span>{{item.goodsName}}</div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="goodsSpecName" label="规格型号" min-width="200">
+              <template slot-scope="scope">
+                <div style="text-align: left;" v-for="(item, index) in scope.row.orderDetails" :key="index"><span v-if="scope.row.orderDetails.length > 1">{{index+1}}. </span>{{item.goodsSpecName}}</div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="totalAmount" label="金额" min-width="80"></el-table-column>
+            <el-table-column align="center" prop="saleName" label="业务员" min-width="80"></el-table-column>
+            <el-table-column align="center" prop="saleMobile" label="业务员电话" min-width="120"></el-table-column>
+            <el-table-column align="center" prop="receUserName" label="客户名称" min-width="80"></el-table-column>
+            <el-table-column align="center" prop="recePhone" label="客户电话" min-width="120"></el-table-column>
+            <el-table-column align="center" prop="receAddress" label="客户地址" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" prop="saleType" label="销售类型" min-width="80">
+              <template slot-scope="scope">
+                {{scope.row.saleType | saleTypeFilter}}
+              </template>
+            </el-table-column>
+            <!-- <el-table-column align="center" prop="goodsPrice" label="支付状态" min-width="80"></el-table-column> -->
+            <el-table-column align="center" prop="payType" label="支付方式" min-width="80"></el-table-column>
+            <!-- <el-table-column align="center" prop="goodsPrice" label="支付订单号" min-width="80"></el-table-column> -->
+            <el-table-column align="center" prop="payTime" label="支付时间" min-width="160"></el-table-column>
+            <el-table-column align="center" prop="createBy" label="创建人" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" prop="createTime" label="创建时间" min-width="160"></el-table-column>
+            <el-table-column align="center" prop="examineBy" label="审批人" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" prop="examineTime" label="审批时间" min-width="160"></el-table-column>
+          </el-table>
+        </div>
+        <div class="pagination clearfix">
+          <div class="fr">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="10"
+              background
+              layout="prev, pager, next"
+              :total="listTotal">
+            </el-pagination>
+          </div>
+        </div>
+        
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="isShowOrderDialog = false;">关 闭</el-button>
+          <el-button type="primary" @click="confirmOrderDialog">确 定</el-button>
+        </span>
+      </el-dialog>
+
+    </template>
+  </zj-tab-page>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+import { getToken } from '@/utils/auth'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import { getSalesReturnOrderList, salesReturnOrderListExport, salesReturnOrderSave, getSalesReturnOrderDetail, salesReturnOrderExamine, getOrderTypeList, getList, getOrderCodeList, getOrderDetail } from "@/api/order";
+import operation_mixin from '@/components/template/operation_mixin.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+
+export default {
+  components: { TemplatePage, geographicalPosi },
+  mixins: [import_mixin,operation_mixin],
+  filters: {
+    saleTypeFilter(val) {
+      const MAP = {
+        1: '商城销售',
+        2: '线下销售',
+      }
+      return MAP[val];
+    },
+    unitFilter(val) {
+      const MAP = {
+        C: '整套',
+        I: '单个'
+      }
+      return MAP[val];
+    },
+    payTypeFilter(val) {
+      const MAP = {
+        WECHAT: '微信支付',
+        CASH: '现金支付',
+        TRANSFER: '转账支付',
+      }
+      return MAP[val];
+    },
+    examineStatusFilter(val) {
+      const MAP = {
+        WAIT: '待审批',
+        OK: '审批通过',
+        FAIL: '审批驳回',
+      }
+      return MAP[val];
+    }
+  },
+  data() {
+    return {
+      baseURL: process.env.VUE_APP_BASE_API,
+      myHeaders: { 'x-token': getToken() },
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ["新增", "编辑"],
+      formDialog: false,
+      formData: {
+        id: '',
+        companyWechatName: '',
+        orderId: '',
+        saleType: '',
+        saleName: '', // 业务员
+        saleMobile: '', // 业务员电话
+        orderSmallType: '', // 工单类型
+        createTime: '',
+        receUserName: '',
+        recePhone: '',
+        receAddress: '',
+
+        remark: '', // 备注
+        fileUrl: '', // 附件
+      },
+      formRules: {},
+      formType: 'add',
+      formVisible: false,
+
+      examineStatus: '',
+      orderTypeList: [],
+      goodsList: [],
+      codeList: [],
+      curTabs: 'a',
+
+      detailData: {},
+
+      pageType: '',
+
+      isShowOrderDialog: false,
+      screenForm: {
+        orderId: '',
+        userName: '',
+        phone: '',
+        productName: '',
+      },
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      orderList: [],
+      waitChooseOrder: [],
+    }
+  },
+  computed: {
+    ...mapGetters(['name']),
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth("add", {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ],
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return []
+    }
+  },
+
+  created() {
+		if(this.$route.query.orderId) {
+      this.$nextTick(() => {
+        this.openForm('add');
+        getOrderDetail({ orderId: this.$route.query.orderId }).then((res) => {
+          const data = res.data;
+          this.formData.orderId = data.orderId;
+          this.formData.saleType = data.saleType;
+          this.formData.saleName = data.saleName;
+          this.formData.saleMobile = data.saleMobile;
+          this.formData.createTime = data.createTime;
+          this.formData.receUserName = data.receUserName;
+          this.formData.recePhone = data.recePhone;
+          this.formData.receAddress = data.receAddress;
+          data.orderDetails.forEach(item => {
+            item.waitRefundNum = item.num;
+            item.waitRefundPrice = item.price;
+          })
+          this.goodsList = data.orderDetails;
+        })
+      })
+    }
+    
+  },
+
+  methods: {
+    // 列表请求函数
+    // getList: getSalesReturnOrderList,
+    getList(p) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        if (this.examineStatus) {
+          pam.params.push({ "param": "a.examine_status", "compare": "=", "value": this.examineStatus })
+        }
+        return getSalesReturnOrderList(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: salesReturnOrderListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    // 切换状态
+    changeType(val) {
+      this.$refs.pageRef.refreshList()
+    },
+    // 表格操作列
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return row.examineStatus != 'OK'
+          },
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.openForm('edit', row.id)
+          }
+        },
+        detail: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.openDetail('detail', row.id)
+          }
+        },
+        examine: {
+          conditions: ({ row, index, column }) => {
+            return row.examineStatus === 'WAIT'
+          },
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.openDetail('examine', row.id)
+          }
+        },
+      })
+    },
+    openForm(type, id) {
+      this.$refs.tabPage.addTab({
+      	// 对应显示的模块
+      	activeKey: type,
+      	// 唯一标识
+      	key: type,
+      	// 页签名称
+      	label: ({ add: '新增', edit: '编辑' })[type],
+      	// 打开时事件
+      	triggerEvent: () => {
+          this.pageType = type;
+      		this.formCancel()
+      		this.$nextTick(()=>{
+            // this.getOrderTypeList();
+      			this.formType = type
+      			this.formVisible = true
+            if (type == 'add') {
+      				this.formDialogType = 0
+              this.formData.companyWechatName = this.name;
+      			} else if(type == 'edit'){
+      				this.formDialogType = 1
+      				getSalesReturnOrderDetail({ id }).then(res => {
+                const data = res.data;
+                this.formData.id = data.id;
+                this.formData.companyWechatName = data.companyWechatName;
+                this.formData.orderId = data.orderId;
+                this.formData.saleType = data.orderInfo.saleType;
+                this.formData.saleName = data.orderInfo.saleName;
+                this.formData.saleMobile = data.orderInfo.saleMobile;
+                this.formData.createTime = data.orderInfo.createTime;
+                this.formData.receUserName = data.orderInfo.receUserName;
+                this.formData.recePhone = data.orderInfo.recePhone;
+                this.formData.receAddress = data.orderInfo.receAddress;
+
+                this.formData.remark = data.remark;
+                this.formData.fileUrl = data.fileUrls;
+
+                data.orderOfflineRefundItems.forEach(item => {
+                  item.waitRefundNum = item.refundNum;
+                  item.waitRefundPrice = item.refundAmount;
+                  item.refundNum = item.retiredNum;
+                  item.refundAmount = item.retiredAmount;
+                })
+
+                this.goodsList = data.orderOfflineRefundItems;
+                this.codeList = data.orderOfflineItemCodes;
+      				  // Object.assign(this.formData, res.data)
+      				})
+      			}
+      		})
+      	},
+      	// 关闭时事件
+      	closeEvent: () => {
+			    this.formCancel()
+      	}
+      })
+    },
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.formData.id = '';
+      this.formData.orderId = '';
+      this.formData.fileUrl = '';
+      this.goodsList = [];
+      this.$data.formRef = this.$options.data().formRef
+    },
+    formConfirm(cancel) {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          salesReturnOrderSave({
+            id: this.formData.id || '',
+            orderId: this.formData.orderId,
+            remark: this.formData.remark,
+            fileUrls: this.formData.fileUrl,
+            orderOfflineRefundItems: this.goodsList.map(item => {
+              return {
+                orderId: this.formData.orderId,
+                orderDetailId: item.orderDetailId,
+                refundNum: item.waitRefundNum,
+                refundAmount: item.waitRefundPrice,
+              }
+            }),
+            orderOfflineItemCodes: this.codeList
+          }).then(res => {
+            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+            cancel('list')
+            this.$refs.pageRef.refreshList()
+          })
+        }
+      })
+    },
+
+    openDetail(type, id) {
+      this.$refs.tabPage.addTab({
+      	// 对应显示的模块
+      	activeKey: type,
+      	// 唯一标识
+      	key: type,
+      	// 页签名称
+      	label: ({ detail: '详情', examine: '审核' })[type],
+      	// 打开时事件
+      	triggerEvent: () => {
+          this.pageType = type;
+      		this.formCancel()
+      		this.$nextTick(()=>{
+            if (type == 'detail') {
+      				this.formDialogType = 0
+      			} else if(type == 'examine'){
+      				this.formDialogType = 1
+      			}
+            getSalesReturnOrderDetail({ id }).then(res => {
+              this.detailData = res.data;
+            })
+      		})
+      	},
+      	// 关闭时事件
+      	closeEvent: () => {
+			    this.detailCancel()
+      	}
+      })
+    },
+    detailCancel() {
+      this.formVisible = false
+    },
+    detailConfirm(cancel) {
+      salesReturnOrderExamine({
+        id: this.detailData.id,
+        examineStatus: 'OK',
+      }).then(res => {
+        this.$message({ type: 'success', message: `审批成功!` })
+        cancel('list')
+        this.$refs.pageRef.refreshList()
+      })
+    },
+
+    // 附件 - 上传成功
+    uploadSuccess(res, file) {
+      this.formData.fileUrl = res.data.url;
+    },
+
+    // 附件 - 上传前
+    beforeUpload(file) {
+      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
+      const whiteList = ['jpg', 'jpeg', 'png'];
+      if (whiteList.indexOf(fileSuffix) === -1) {
+        this.$errorMsg('只支持上传jpg/png文件!');
+        return false;
+      }
+    },
+
+    openOrderDialog() {
+      this.getOrderList();
+      this.isShowOrderDialog = true;
+    },
+
+    // table点击选择商品
+    handleChooseGoods(val) {
+      this.waitChooseOrder = val;
+    },
+
+    getOrderList() {
+      getList({
+        orderStatus: 'YFH,OVER',
+        orderId: this.screenForm.orderId, // 订单号
+        productName: this.screenForm.productName, // 商品名称
+        userName: this.screenForm.userName, // 会员昵称
+        phone: this.screenForm.phone, // 手机号
+        pageNum: this.currentPage,
+        pageSize: this.pageSize
+      }).then(res => {
+        this.orderList = res.data.records;
+        this.listTotal = res.data.total;
+      })
+    },
+
+     // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getOrderList();
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getOrderList();
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getOrderList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getOrderList();
+    },
+
+    confirmOrderDialog() {
+      if(this.waitChooseOrder.length < 1) {
+        return this.$errorMsg('请选择订单');
+      }
+      if(this.waitChooseOrder.length > 1) {
+        return this.$errorMsg('最多选择一个订单');
+      }
+      const data = this.waitChooseOrder[0];
+      this.formData.orderId = data.orderId;
+      this.formData.saleType = data.saleType;
+      this.formData.saleName = data.saleName;
+      this.formData.saleMobile = data.saleMobile;
+      this.formData.createTime = data.createTime;
+      this.formData.receUserName = data.receUserName;
+      this.formData.recePhone = data.recePhone;
+      this.formData.receAddress = data.receAddress;
+      data.orderDetails.forEach(item => {
+        item.waitRefundNum = item.num;
+        item.waitRefundPrice = item.price;
+      })
+      this.goodsList = data.orderDetails;
+
+      getOrderCodeList({orderId: data.orderId}).then(res => {
+        this.codeList = res.data;
+      })
+
+      this.isShowOrderDialog = false;
+    },
+
+    // 删除商品
+    deleteGoods(index) {
+      this.goodsList.splice(index, 1);
+    },
+
+    // 删除条码
+    deleteCode(index) {
+      this.codeList.splice(index, 1);
+    },
+
+    // 获取工单类型列表
+    getOrderTypeList() {
+      getOrderTypeList({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{param: "a.status", compare: "=", value: true}]
+      }).then(res => {
+        this.orderTypeList = res.data.records;
+      })
+    },
+
+
+  }
+}
+</script>
+
+<style lang="scss">
+.specTable .el-table__cell {
+  padding: 0 !important;
+}
+
+// 图片墙
+.el-upload-list--picture-card .el-upload-list__item {
+  width: 100px;
+  height: 100px;
+}
+
+.el-upload--picture-card {
+  width: 100px;
+  height: 100px;
+  line-height: 100px;
+
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 100px;
+    height: 100px;
+    line-height: 100px;
+    text-align: center;
+  }
+}
+</style>