|
@@ -0,0 +1,118 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @check="toCheck" @del="toDel" @market="toMarket"> </data-table>
|
|
|
+ <el-dialog :title="dialog.title" :visible.sync="dialog.show" :width="dialog.width" :before-close="toClose" :close-on-click-modal="false">
|
|
|
+ <check-1 v-if="dialog.type == '1'" :form="form" @resetForm="toClose" @onSubmit="onSubmit"></check-1>
|
|
|
+ <market-1 v-if="dialog.type == '2'" :form="form"></market-1>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import check1 from './parts/check-1.vue';
|
|
|
+import market1 from './parts/market-1.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: mapApply } = createNamespacedHelpers('apply');
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ check1,
|
|
|
+ market1,
|
|
|
+ },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ fields: [
|
|
|
+ { label: '申报人', prop: 'apply_personal', filter: 'input' },
|
|
|
+ { label: '联系电话', prop: 'apply_phone', filter: 'input' },
|
|
|
+ { label: '审核人', prop: 'examine_personal' },
|
|
|
+ { label: '审核时间', prop: 'examine_date' },
|
|
|
+ {
|
|
|
+ label: '审核状态',
|
|
|
+ prop: 'status',
|
|
|
+ format: (i) => {
|
|
|
+ return i === '0' ? '待审中' : i === '1' ? '审核通过' : '审核拒绝';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ opera: [
|
|
|
+ { label: '申报商品', method: 'market' },
|
|
|
+ { label: '审核', method: 'check' },
|
|
|
+ { label: '删除', method: 'del', type: 'danger' },
|
|
|
+ ],
|
|
|
+ // 弹框
|
|
|
+ dialog: { title: '申报审核', show: false, type: '1', width: '50%' },
|
|
|
+ // 审核
|
|
|
+ form: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapApply(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
+ 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 }) {
|
|
|
+ data.examine_personal = this.user.name;
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ this.dialog = { title: '申报审核', show: true, type: '1', width: '50%' };
|
|
|
+ },
|
|
|
+ // 提交审核
|
|
|
+ async onSubmit({ data }) {
|
|
|
+ let res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({ type: `success`, message: `操作成功` });
|
|
|
+ this.toClose();
|
|
|
+ } else {
|
|
|
+ this.$message({ type: `error`, message: `${res.errmsg}` });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查看申報商品
|
|
|
+ toMarket({ data }) {
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ this.dialog = { title: '申报商品', show: true, type: '2', width: '30%' };
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ async toDel({ data }) {
|
|
|
+ let res = await this.delete(data.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({ type: `success`, message: `操作成功` });
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭
|
|
|
+ toClose() {
|
|
|
+ this.search();
|
|
|
+ this.dialog = { title: '申报审核', show: false, type: '1', width: '50%' };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+}
|
|
|
+</style>
|