|
@@ -4,9 +4,15 @@
|
|
|
:liebiaoList="liebiaoList"
|
|
|
@query="search"
|
|
|
:total="total"
|
|
|
- @deleteRow="deleteRow"
|
|
|
:resultTable="resultTable"
|
|
|
@onsave="onsaveClick"
|
|
|
+ @success="success"
|
|
|
+ @shibai="shibai"
|
|
|
+ :limit="limit"
|
|
|
+ @handleCurrentChange="handleCurrentChange"
|
|
|
+ :pageSize="pageSize"
|
|
|
+ :display="display"
|
|
|
+ @searchinfo="look"
|
|
|
></appointment-detail>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -15,7 +21,9 @@
|
|
|
import appointmentDetail from '@/components/enterprise/appointment.vue';
|
|
|
import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
|
|
|
const { mapActions: dock } = createNamespacedHelpers('dock');
|
|
|
+const { mapActions: apply } = createNamespacedHelpers('apply');
|
|
|
const { mapActions: login } = createNamespacedHelpers('login');
|
|
|
+
|
|
|
export default {
|
|
|
name: 'adviserList',
|
|
|
props: {},
|
|
@@ -24,7 +32,11 @@ export default {
|
|
|
},
|
|
|
data: () => ({
|
|
|
total: 0,
|
|
|
+ limit: 4,
|
|
|
+ pageSize: 4,
|
|
|
info: {},
|
|
|
+ datas: {},
|
|
|
+ display: 'list',
|
|
|
liebiaoList: [
|
|
|
{ name: '基本信息' },
|
|
|
{ name: '消息管理' },
|
|
@@ -46,6 +58,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...dock(['query', 'delete', 'update']),
|
|
|
+ ...apply({ applyupdate: 'update' }),
|
|
|
...login({ logout: 'logout', transactiondtetle: 'delete' }),
|
|
|
//查询
|
|
|
async search({ skip = 0, limit = 4 } = { skip: 0, limit: 4 }) {
|
|
@@ -56,10 +69,24 @@ export default {
|
|
|
console.log();
|
|
|
},
|
|
|
|
|
|
- search1({ skip, limit }) {
|
|
|
- console.log(skip);
|
|
|
+ //查询
|
|
|
+ async searchinfo({ skip = 0, limit = 4, currentPage } = { skip: 0, limit: 4 }) {
|
|
|
+ this.display = 'dadad';
|
|
|
+ this.$set(this, `total`, this.datas.apply.length);
|
|
|
+ const newProducts = [];
|
|
|
+ for (let index = skip; index < skip + limit; index++) {
|
|
|
+ if (this.datas.apply[index]) {
|
|
|
+ newProducts.push(this.datas.apply[index]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this, `resultTable`, newProducts);
|
|
|
},
|
|
|
|
|
|
+ look(row) {
|
|
|
+ this.display = 'dadad';
|
|
|
+ this.$set(this, `datas`, row);
|
|
|
+ this.searchinfo();
|
|
|
+ },
|
|
|
async onsaveClick({ id }) {
|
|
|
console.log(id);
|
|
|
if (id === '基本信息') {
|
|
@@ -89,10 +116,28 @@ export default {
|
|
|
async toLogin() {
|
|
|
this.$router.push({ path: '/' });
|
|
|
},
|
|
|
+ handleCurrentChange({ currentPage }) {
|
|
|
+ this.searchinfo({ skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
|
|
|
+ console.log(currentPage);
|
|
|
+ },
|
|
|
+ async success(row) {
|
|
|
+ row.status = '1';
|
|
|
+ console.log(this.datas);
|
|
|
+ row.dock_id = this.datas.id;
|
|
|
+ row.id = row._id;
|
|
|
+ console.log(row);
|
|
|
|
|
|
- async deleteRow(id) {
|
|
|
- const res = await this.delete(id);
|
|
|
- if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) this.search();
|
|
|
+ let res = await this.applyupdate(row);
|
|
|
+ this.$checkRes(res, '通过审核', '添加失败');
|
|
|
+ },
|
|
|
+ async shibai(row) {
|
|
|
+ row.status = '2';
|
|
|
+ console.log(this.datas);
|
|
|
+ row.dock_id = this.datas.id;
|
|
|
+ row.id = row._id;
|
|
|
+ console.log(row);
|
|
|
+ let res = await this.applyupdate(row);
|
|
|
+ this.$checkRes(res, '审核拒绝', '添加失败');
|
|
|
},
|
|
|
},
|
|
|
};
|