|
@@ -0,0 +1,124 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @check="toCheck" @viewMarket="viewMarket"> </data-table>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-dialog title="审批单审核" :visible.sync="oneShow" width="40%" :before-close="oneClose">
|
|
|
+ <check-1 :form="form" @oneClose="oneClose" @onSubmit="onSubmit"></check-1>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog class="twoDialog" title="商品列表" :visible.sync="twoShow" width="50%" :before-close="twoClose">
|
|
|
+ <list-1 :list="orderList"></list-1>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import check1 from './parts/check-1.vue';
|
|
|
+import list1 from './parts/list-1.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: examine } = createNamespacedHelpers('examine');
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: { check1, list1 },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ fields: [
|
|
|
+ { label: '审批单号', prop: 'order_num', filter: 'input' },
|
|
|
+ { label: '购买人', prop: 'buy_name', filter: 'input' },
|
|
|
+ { label: '购买总价(元)', prop: 'totalMoney' },
|
|
|
+ { label: '审批人', prop: 'personal' },
|
|
|
+ { label: '审批时间', prop: 'examine_time' },
|
|
|
+ {
|
|
|
+ label: '审批结果',
|
|
|
+ prop: 'status',
|
|
|
+ format: (item) => {
|
|
|
+ return item === '0' ? '待审' : item === '1' ? '审核通过' : '审核未通过';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ opera: [
|
|
|
+ { label: '审核', method: 'check' },
|
|
|
+ { label: '查看商品', method: 'viewMarket' },
|
|
|
+ ],
|
|
|
+ // 审核
|
|
|
+ oneShow: false,
|
|
|
+ form: {},
|
|
|
+ // 商品列表
|
|
|
+ twoShow: false,
|
|
|
+ orderList: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...examine(['query', 'update']),
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ let res = await this.query({ skip, limit, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 审核
|
|
|
+ toCheck({ data }) {
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ this.oneShow = true;
|
|
|
+ },
|
|
|
+ // 提交审核
|
|
|
+ async onSubmit({ data }) {
|
|
|
+ let res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({ type: `success`, message: `操作成功` });
|
|
|
+ this.search();
|
|
|
+ this.oneClose();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭审核
|
|
|
+ oneClose() {
|
|
|
+ this.oneShow = false;
|
|
|
+ },
|
|
|
+ // 查看商品
|
|
|
+ viewMarket({ data }) {
|
|
|
+ this.$set(this, `orderList`, data.order);
|
|
|
+ this.twoShow = true;
|
|
|
+ },
|
|
|
+ // 关闭商品
|
|
|
+ twoClose() {
|
|
|
+ this.twoShow = false;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+/deep/.el-dialog__body {
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+.twoDialog {
|
|
|
+ /deep/.el-dialog__body {
|
|
|
+ max-height: 300px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|