Преглед на файлове

60:商品订单审核操作

Long преди 2 дни
родител
ревизия
ac52f129bc
променени са 4 файла, в които са добавени 282 реда и са изтрити 3 реда
  1. 19 0
      src/api/store/storeOrderAudit.js
  2. 2 1
      src/layout/index.vue
  3. 21 2
      src/views/store/components/productOrder.vue
  4. 240 0
      src/views/store/storeOrderAudit/index.vue

+ 19 - 0
src/api/store/storeOrderAudit.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 获取审核列表
+export const list = (query) => {
+  return request({
+    url: '/store/storeOrderAudit/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 审核
+export const audit = (data) => {
+  return request({
+    url: '/store/storeOrderAudit/audit',
+    method: 'post',
+    data: data
+  })
+}

+ 2 - 1
src/layout/index.vue

@@ -58,6 +58,7 @@
                :fullscreen="qw.isMaximized"
                :visible.sync="qw.open"
                :style="{visibility: !qw.initLoad ? 'hidden' : 'unset'}"
+               :modal="qw.initLoad"
                :title="qw.title">
 <!--      <template #title>-->
 <!--        <span>{{ qw.title }}</span>-->
@@ -144,7 +145,7 @@ export default {
         this.qw.open = false
         setTimeout(() => {
           this.qw.initLoad = true
-        },  50)
+        },  500)
       })
     }
   },

+ 21 - 2
src/views/store/components/productOrder.vue

@@ -274,6 +274,23 @@
           </template>
         </el-table-column>
       </el-table>
+
+        <div style="margin-top: 20px">
+          <span class="font-small">审批信息</span>
+        </div>
+        <el-table style="margin-top: 20px;width: 100%"
+                  :data="auditLogs" border>
+          <el-table-column label="操作时间"  width="160" align="center">
+            <template slot-scope="scope">
+              {{scope.row.createTime}}
+            </template>
+          </el-table-column>
+          <el-table-column label="备注" align="center">
+            <template slot-scope="scope">
+              {{scope.row.content}}
+            </template>
+          </el-table-column>
+        </el-table>
       </el-card>
     </div>
     <el-dialog :title="edit.title" :visible.sync="edit.open" width="600px" append-to-body>
@@ -585,6 +602,7 @@ export default {
       express:[],
       traces:[],
       payments:[],
+      auditLogs: []
     };
   },
   created() {
@@ -622,7 +640,7 @@ export default {
         setTimeout(() => {
             that.$refs.sms.getOrderId(this.orderId,mobile,2);
         }, 500);
-        
+
     },
     handlePhone(){
       const id = this.order.id;
@@ -634,7 +652,7 @@ export default {
       const id = this.order.id;
       getStoreOrderAddress(id).then(response =>{
           this.order.userAddress = response.address;
-      }) 
+      })
     },
     showImageDialog() {
       this.dialogVisible = true;
@@ -847,6 +865,7 @@ export default {
             this.items = response.items;
             this.payments=response.payments;
             this.customerInfo=response.customer;
+            this.auditLogs = response.auditLogs;
         });
      }
   }

+ 240 - 0
src/views/store/storeOrderAudit/index.vue

@@ -0,0 +1,240 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="所属员工" prop="companyUserName">
+        <el-input
+          v-model="queryParams.companyUserName"
+          placeholder="请输入所属员工昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="全部" name="00"></el-tab-pane>
+      <el-tab-pane label="待销售审批" name="0"></el-tab-pane>
+      <el-tab-pane label="销售审批拒绝" name="1"></el-tab-pane>
+      <el-tab-pane label="待总后台审核" name="2"></el-tab-pane>
+      <el-tab-pane label="总后台审核拒绝" name="3"></el-tab-pane>
+      <el-tab-pane label="审核通过" name="4"></el-tab-pane>
+    </el-tabs>
+    <el-table height="500" border v-loading="loading" :data="storeOrderAuditList" :key="tableKey">
+      <el-table-column label="订单号" align="center" prop="orderCode" width="200" />
+      <el-table-column label="所属公司" align="center" prop="companyName" />
+      <el-table-column label="所属员工" align="center" prop="companyUserName" />
+      <el-table-column label="审核状态" align="center" prop="status" >
+        <template slot-scope="scope">
+          <el-tag prop="status" v-for="item in statusOptions"
+                  :type="item.type"
+                  v-if="scope.row.auditStatus === item.dictValue">
+            {{item.dictLabel}}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="销售审核时间" align="center" prop="companyAuditTime" />
+      <el-table-column label="销售审核人" align="center" prop="companyAuditUserName" />
+      <el-table-column label="总后台审核时间" align="center" prop="adminAuditTime" />
+      <el-table-column label="总后台审核人" align="center" prop="adminAuditUserName" />
+      <el-table-column label="被拒原因" align="center" prop="reason" show-overflow-tooltip />
+      <el-table-column label="提交时间" align="center" prop="createTime" />
+      <el-table-column label="操作" fixed="right" align="center" width="80" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-popover
+            v-if="scope.row.auditStatus === 0"
+            placement="right"
+            trigger="click"
+            :ref="'popover_' + scope.row.id">
+            <el-button size="mini" type="success" @click="handlePass(scope.row)">通过</el-button>
+            <el-button size="mini" type="danger" @click="handleAudit(scope.row)">拒绝</el-button>
+            <el-button
+              slot="reference"
+              size="mini"
+              type="text"
+              v-hasPermi="['store:storeOrderAudit:audit']"
+            >审核订单</el-button>
+          </el-popover>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <el-dialog :title="show.title" :visible.sync="show.open" width="500px" append-to-body>
+      <el-form ref="auditForm" :model="auditForm" :rules="auditRules" label-width="80px">
+        <el-form-item label="拒绝原因" prop="reviewContent">
+          <el-input
+            type="textarea"
+            v-model="auditForm.reviewContent"
+            placeholder="请输入拒绝原因"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="handleReject">确定</el-button>
+        <el-button @click="cancelAudit">关闭</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getCompanyList } from "@/api/company/company";
+import {list, audit} from "@/api/store/storeOrderAudit";
+
+export default {
+  name: "StoreOrderAudit",
+  data() {
+    const statusOptions = [
+      {
+        dictLabel: "待销售审批",
+        dictValue: 0,
+        type: ''
+      },
+      {
+        dictLabel: "销售审批拒绝",
+        dictValue: 1,
+        type: 'danger'
+      },
+      {
+        dictLabel: "待总后台审核",
+        dictValue: 2,
+        type: ''
+      },
+      {
+        dictLabel: "总后台审核拒绝",
+        dictValue: 3,
+        type: 'danger'
+      },
+      {
+        dictLabel: "审核通过",
+        dictValue: 4,
+        type: 'success'
+      }
+    ]
+
+    return {
+      tableKey: 0,
+      showSearch: true,
+      companys: [],
+      total: 0,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        companyUserName: null,
+        auditStatus: null
+      },
+      activeName: '00',
+      loading: false,
+      storeOrderAuditList: [],
+      statusOptions: statusOptions,
+      show: {
+        open: false,
+        title: "审核订单"
+      },
+      auditForm: {
+        auditId: null,
+        reviewType: null,
+        reviewContent: ''
+      },
+      auditRules: {
+        reviewContent: [
+          { required: true, message: "请输入拒绝原因", trigger: "blur" }
+        ]
+      },
+      currentRowId: null,
+    }
+  },
+  created() {
+    this.getCompanyOptions()
+    this.handleQuery()
+  },
+  activated() {
+    this.tableKey = Date.now()
+  },
+  methods: {
+    getCompanyOptions() {
+      getCompanyList().then(response => {
+        this.companys = response.data
+      })
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    getList() {
+      this.loading = true
+      list(this.queryParams).then(response => {
+        const {rows, total} = response
+        this.storeOrderAuditList = rows
+        this.total = total
+        this.loading = false
+      })
+    },
+    handleClick(tab) {
+      this.queryParams.auditStatus = tab.name === '00' ? null : tab.name
+      this.handleQuery()
+    },
+    handleAudit(row) {
+      this.currentRowId = row.id
+      this.auditForm.auditId = row.id;
+      this.auditForm.reviewType = 0;
+      this.show.open = true;
+    },
+    handlePass(row) {
+      this.currentRowId = row.id
+      this.auditForm.auditId = row.id;
+      this.auditForm.reviewType = 1;
+      this.submitAudit();
+    },
+    handleReject() {
+      this.$refs["auditForm"].validate(valid => {
+        if (valid) {
+          this.submitAudit();
+        }
+      });
+    },
+    submitAudit() {
+      audit(this.auditForm).then(response => {
+        const {msg} = response
+        this.msgSuccess(msg);
+        this.show.open = false;
+        this.$refs['popover_' + this.currentRowId].doClose();
+        this.getList();
+        this.resetAuditForm();
+      });
+    },
+    cancelAudit() {
+      this.show.open = false;
+      this.resetAuditForm();
+    },
+    resetAuditForm() {
+      this.auditForm = {
+        auditId: null,
+        reviewType: null,
+        reviewContent: ''
+      };
+      this.$refs["auditForm"]?.resetFields();
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>